Tutorials

How to add Custom Fields [metadata] for categories and tags [terms]

Pinterest LinkedIn Tumblr

WordPress custom fields give great flexibility to customize posts and pages, which let users create variables and add custom values to them. See detail on: The Power of WordPress Custom Fields.  If you want to use Custom Field out of loop, than you must read this small article “WordPress: How to get custom fields outside the loop” which help you to do that.
This excellent WordPress feature must help a lot to bloggers, if they use for Categories and Tags (terms) and that can be achieable by using  Category Meta plugin, so following are the useful features you can get from this plugin.

Insert Images to Category or Tag:

251px-Html-tag-italicized

Whenever a category or tag are archived, an image will be appeared, because that image could be attached through custom field with that particular category or tag.

To Display Banners ads with Category or tag:

banner-advertising

Bloggers can associate banner ads with category or tag by using custom field, because banner ad code could be stored in a custom field.

To View Stats of Category or tag:

page3_blog_entry106-web_counter_stats

You can track the number of visitors of category or tag pages, this feature is also available for pages and post by using plugins like WP-PostViews.

Right now  a plugin “WP Category Meta” is not compatible  with WordPress 3.2. This plugin adds an additional table “wp-termsmeta”  in your database to add terms meta, As well you have to add PHP functions to update and access the terms meta as follow:

Installation Instruction:

sculture_wolf

  1. Unzip into your /wp-content/plugins/ directory. If you’re uploading it make sure to upload the top-level folder. Don’t just upload all the php files and put them in /wp-content/plugins/.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Go to your Administration interface in the “Settings” menu a new “Category Meta” page is created. Configure the meta you want to use.
  4. go to your Administration interface, in the “Category” menu -> new fields are displayed in the category creation/modification form with the meta you configured.
  5. That’s it!
  6. you can use the folowing functions into your templates to retreive 1 meta:
if (function_exists('get_terms_meta'))
{
    $metaValue = get_terms_meta($category_id, $meta_key);
}
  1. you can use the folowing functions into your templates to retreive all meta:
if (function_exists('get_all_terms_meta'))
{
    $metaList = get_all_terms_meta($category_id);
}

Download | Detail

Noor Mustafa Raza

I am a WordPress Developer and Designer, author @WPArena. I am providing Free WordPress consultation and can help you to install WordPress in a secure way to small businesses and bloggers.

Write A Comment

Pin It