March 29th in Wordpress by pbu .

How to get custom field value in WordPress?

Custom fields often associated with blog post and are widely expoited by wordpress programmers and theme

designers to store various values. Here is a easy way to fetch the custom field value in wordpress.

Just remember that this will only work if placed within the wordpress loop.

<?php
$zip_code = get_post_meta($post->ID, "zipcode", true);
echo $zip_code;
?>

Amazingly Simple! isnt it?

Similar Posts:

Share and Enjoy:
  • del.icio.us
  • digg
  • StumbleUpon
  • Technorati
  • DZone
  • Facebook
  • FriendFeed
  • Reddit
  • RSS
  • Twitter

Leave A Comment.