Wordpress 3.0 Benefits: Custom Fields

Jun 27th, 2010

Very recently, I have download the Wordpress 3.0 and installed on my laptop and office PC also. Just after downloading, I thought about the new buzzwords going around for Wordpress 3.0. and few points attracted my eye were these:

- WordPress and WordPress MU have merged. This means we can run multiple sites on same wordpress installation,

- New custom menu management feature,

- Custom header and background APIs,

- Contextual help text accessed under the Help tab of every screen in the WordPress administration,

- Ability to set the admin username and password during installation (good for security),

- Improved Custom Post Types and Custom Taxonomies.

Having read the benefits of Wordpress 3.0, I pounced on few things after installation was custom masthead and Custom Fields. I have played with Custom Masthead feature first and then use Custom Fields. It is a good functionality added to Wordpress 3.0 but it is not a great one now. I will tell you later why I think so.

For using a Custom Fields, you need to add <?php the_meta(); ?> to your single post template (single.php).

Wordpress Custom Fields
Please, click on the image to see larger version of the image. the_meta() is almost at bottom (3rd from bottom) and the_content() is at the top (4th from top).

The Custom fields will come on bottom of each post. The above image show where I have added the custom field tag to show custom fields on each post. Please change position to perfectly appear on your blog's post page.

Now you need to add data to custom fields. It is optional and it depends on your WP theme. Go to any post and look after the post editor box. You should see Box. For me it is coming after Post, Excerpt, Send Trackback. All box there are draggable so you can drag according to your suitability. I have added key as 'Author' and Value as 'Satya'. and it will come like this - <b>Author: Satya</b>. It usage the source code as below:

<ul class='post-meta'>
<li><span class='post-meta-key'>Key1:</span> Value1</li>
<li><span class='post-meta-key'>Key2:</span> Value2</li>
</ul>

So, depending on style setting one has for list, the look will come on page. Using CSS class name (post-meta),
CSS can be added to to change the appearance of the Custom Field output.

Why this Custom Fields functionality is not Great now?

If you want to use a certain value on all posts, you cannot do that! What ever you enter on a post in key value pair fields will appear on that post and only key will carry to all post. So you can use that key on another post. Value you need to enter manually on each post. This is only good if you enter some new text for each post. We can set it so that certain text can appear on each posts then I want to use this for various usage like Facebook Like button, etc. I can think of that as I got a place which can be customized from the post itself.

For reading more about Wordpress 3.0 benefits, please follow the link.

 
Possibly Related posts:
  • http://topsy.com/www.satya-weblog.com/2010/06/wordpress-3-0-benefits-custom-fields.html?utm_source=pingback&utm_campaign=L2 Tweets that mention Wordpress 3.0 benefits: Custom Fields — Topsy.com

    [...] This post was mentioned on Twitter by Web Development, Web Scripting. Web Scripting said: new post Wordpress 3.0 benefits: Custom Fields http://bit.ly/cNxciA on satya-weblog.com [...]

blog comments powered by Disqus