Monday, December 5, 2011

How To Create Custom Fields In Your WordPerss Blog- Advanced Custom Field Widget.

Advanced Custom Field Widget is a great plugin that I have ever seen for creating our own custom field in WordPress blog. This plugin will make our blog more flexible like any other CMS. We can avoid lots of unwanted,complicated codes and time by using this advanced custom field widget.

We can add our own custom field names and custom field values to our blog posts. And later we can retrieve these values in our blog using get_post_meta() function.

How To Install and Configure?

You can download Advanced Custom Field Widget from here. And activate the plugin from the plugin page in wordpress dashboard. Now you can use this plugin from Settings >adv custom fields.

How to use Custom fields in your theme?
 Use get_post_meta() function to fetch meta values into your theme:

get_post_meta($post_id, $key, $single);

  • Here the $post_id is the ID of the post that we want the meta value for. 
  •  $key is indicating a string contain the name of Meta value. 
  •  $single can either be true or false. The function will return a single result if $single is true, And will return a array and if $single is false or not set.

Get_post_meta(10,”Phone Num”,True).

Sample Screen Shots



To know more about custom fields please visit http://codex.wordpress.org/Custom_Fields. Hope this article will help you. 

Kindly Bookmark this Post using your favorite Bookmarking service:
Technorati Digg This Stumble Stumble Facebook Twitter


Post a Comment

Related Posts Plugin for WordPress, Blogger...

Recent Posts

About Me

My Photo

Avid web coder | Blogger | Media fan | Martial Arts Trainer (I was :P ) | Founder of http://www.learnwebtipz.com

Recent Comments

| Learn Web Tips - A Blog For Learn And Discuss Web Tricks And Tips © 2012. All Rights Reserved | Template Style by My Blogger Tricks .com | Design by Brian Gardner | | Back To Top |