Hi, I'm new on this (I used sandbox for wp). I want to retrieve post_meta to show it in the content/page.php.
So to show meta data from a custom field I wrote:
$mymeta = get_post_meta($post->ID,'mifield',true); if($mymeta) { echo $mymet; }
But no data is returning.
But, If I get the current post ID. Like this:
$elid = get_the_id();
$mymeta = get_post_meta($elid,'mifield',true); if($mymeta) { echo $mymet; }
Data es returning.. Why is happening that? Is that in all cases, for example
$post->post_content;
$post->post_title;
And so on?