- Webmaster Tools
- Unblocked Games
Thanks to the need for associating more content with a post, we are able to explore the multiple possibilities available with WordPress post meta. If you're a WordPress user who's been struggling hard with the incorporation of different types of content in your WP posts, then learning about post meta will definitely help you
Here, you'll get a detailed insight into the significance of using post meta in WordPress along with the right method to proceed ahead with the same.
Let's understand the importance of using Post meta in WP with the help of an example. If you've got become bored of the plain, similar-looking titles for your WordPress posts and want to equip them with a different text or link or HTML, then using the post meta is a viable option. With post meta, you can conveniently add extra bits to details to an existing post, thereby customize your WP website for a better look and feel.
To start off, simply login to your WP admin panel. Once you've logged in successfully, simply open the Post Edit Page which can be used for adding a post meta to the chosen post. Next, click on “Add New” option available under Posts menu. Here, you'll be able to view the “custom fields meta box” which contains the post meta. On the contrary, you can click on “Screen Options” link provided towards the top right side of the Post Edit Page and check the “Custom Fields” checkbox for enabling post meta. Here's a screen-shot for the same:
Once you're done with enabling post meta, the following section will be visible towards the bottom of your Post Edit Page:
On the above screen, the drop-down list contains all the post meta keys which have already been added to different WP posts. Here, you can choose the meta key which you want to add to the post under focus. However, you are also free to add a new post meta key by clicking on “Enter New” link displayed within the above screen-shot. Once you're done with specifying a name and value for the post meta, click on “Add Custom Field” for attaching the newly created post meta to the post once the post has been saved or published.
After having added the post meta to your post, use the get_post_meta function for reading the respective post meta. This WordPress function accepts three arguments/parameters listed below:
Apart from the get_post_meta function, WordPress comes loaded with numerous post meta related functions, some of which have been explained below:
Collaborating post meta with your custom post type is a one-step process. All you need to do is simply add custom fields into the supports parameter of WordPress built-in function called register_post_type as shown below:
register_post_type( 'Desktops', array( 'labels' => array( 'name' => __( 'Desktops' ), 'singular_name' => __( 'Desktops' ) ), 'public' => true, 'has_archive' => true, 'supports' => array( 'title', 'editor', 'custom-fields', ) ) );
So, whether you're looking forward to build a photography site or a corporate portal using WordPress, leveraging the possibilities available with post meta is perhaps something that's going to work in your favor.
Jack Calder is working as Web developer in Markupcloud Ltd. Which is the top psd to html conversion company. Instead of all these things he also shares important & useful information regarding new updates.