2″. This code creates a custom post type named “Page” in WordPress.
The code creates a custom post type in WordPress. The post type can be seen by anyone and has an
This code creates a new page in the WordPress admin area. The first parameter is the page title, the second
0 Author: John Doe Author URI: add-plugin.com License: GPLv2 */ ?>
The new page will have the title you specify for $page_title, and the menu item for the page will have
This wordpress code gets all the posts from the wordpress site.
The code above gets an image by its attachment ID and returns the image URL.
The wordpress code $post_id = get_the_ID(); is used to retrieve the post ID of the current post.
The wp_get_attachment_url function retrieves the URL for an attachment. The function takes the attachment ID as its only parameter.
This code will get all of the users for the WordPress site and then loop through each user to display
The wordpress code above is used to retrieve attachment information from the WordPress database. The $attachment_id variable is used to
This code gets all posts from the WordPress database and then loops through each post printing the title of the
outputs the home URL of the WordPress site.
This wordpress code assigns the variable $page_id to the numeric post/page ID of the current page.
The following wordpress code returns the URL of the current blog: $url = get_blog_url();
The code is retrieving the name of the blog from the WordPress settings.
The code above outputs the URL of the WordPress site.
The get_the_author function in WordPress allows you to easily retrieve the author of the current post. This can be useful
is a wordpress function that returns the URL for an archive page.
This wordpress code is used to query all posts and then do something with each post.