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

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

Disclosure: Some of the links in this article are affiliate links and we may earn a small commission if you make a purchase, which helps us to keep delivering quality content to you. Here is our disclosure policy.

Noor Mustafa Raza
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.

LEAVE A REPLY

Please enter your comment!
Please enter your name here
Captcha verification failed!
CAPTCHA user score failed. Please contact us!

spot_img

Related Articles

Why WordPress Is The Best CMS? (And, Possible Alternatives)

Why WordPress is the best CMS? Having a website has become a necessity for both individuals and businesses. Content Management...
Read More
When optimizing the speed of your WordPress site, you might come across a performance metric known as Time to First...
Are you dealing with a broken WordPress site and don't know what to do? If your website is showing a...