Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Custom Field Value in Header WordPress

  • SOLVED

I need to pull a custom field value from the current post and place it the header for some Facebook integration im working on. I know some Open Graph plugins exist for Wordpress, but Im in need of a custom format for a certain page template.

So in the header I need to display:
<meta xmlns:og="http://opengraphprotocol.org/schema/" property="og:description" content="[CUSTOM FIELD VALUE HERE]>" />

I am using a plugin for custom field values called "Get Custom Field Values". Ive tried using <?php echo c2c_get_custom('display-date'); ?> and <?php echo get_post_meta($post->ID, 'display-date', true) ?> and neither work.

Any Help?

Answers (2)

2011-02-05

Nilesh shiragave answers:

try this


<?php
global $post;
echo get_post_meta($post->ID, 'display-date', true)
?>

2011-02-05

Ehthisham tk answers:

may this help you scroll down to 9
http://www.smashingmagazine.com/2009/05/13/10-custom-fields-hacks-for-wordpress/