Creating custom fields for your wordpress

WordPress | on Apr. 07, 2011 | by 0 Comments

Word press is a powerful tool and provides many functions that cannot be afforded by any other equivalent toll. One of the functions that this tool avails to post authors is the ability create custom fields to the posts they have created. The extra information on the posts is called Meta data and can contain information like mood, weather, current music being listened and the book currently being read. According to these parameters, the mood may be happy, around the clock as the current music being listened to, Cinderella as current book being read and the weather at the time being hot and humid. Meta data can also be used to achieve complex functions like including the creation and expiry date of the post.

Key and value components are used with Meta data. While key represents the name of the Meta data element, the value represents the information that appears on the Meta data of each post created in the wordpress site. Keys can be used on several posts depending on the activity that you are doing. For example, if you are reading two books at the same time, you can create the reading Meta data and use on the two books. There are several guidelines that have to be followed in creating Meta data successfully.

The first thing you will do is to create a post and go to the area with the title custom field. This option is usually hidden in the wordpress version 3.1 if it has never been used. To create a new custom field, you will enter the text of choice at the key field. If for example you would like to enter a custom filed named currently reading, you will write the text without quotes on the key field. Newly created key must have value which must be added as soon as the key creation is complete. You will go to the value field and add the value of choice for example the music you are listening to or the book you are reading. These two processes are repeated for different keys and value parameters. Once the two are added, always make sure that you save the changes.

Once you have created Meta data on your posts, you have to display the custom fields. If you would like to display custom fields for each post, you need to use the “the_meta ()”template tag which must be placed on a loop for it to work. This template tag changes the Meta data in to CSS style called the post Meta which makes your work much easier. The key is in a span called post Meta key which allows styling the post into style sheets. You can also customize the appearance and the characteristics of the style sheet. You can also ads other interesting features by using plugins like official wordpress plugin directory and custom field plugins that you can find from Google.
Post Meta information is stored in four fields in the table, Meta id, post id, Meta key and Meta value. The value of the table is brought together in a structured multi dimensional array called post Meta cache.

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks

Leave Your Response

* Name, Email, Comment are Required