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?
Nilesh shiragave answers:
try this
<?php
global $post;
echo get_post_meta($post->ID, 'display-date', true)
?>
Ehthisham tk answers:
may this help you scroll down to 9
http://www.smashingmagazine.com/2009/05/13/10-custom-fields-hacks-for-wordpress/