Just out of interest, what would be the best way to semantically echo custom fields in a WordPress theme.
At the moment I’m using this, with “blueberries” being my custom field.
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'blueberries', true);
Courtesy of WPRecipes.
I guess what I’m asking is, is there a shorter bit of markup I could use?
Here are a few examples on this site:
I prefer checking to see if the value exists first, but based on what you’ve posted it doesn’t look like you need that.
@TheDoc, Cheers dude!
You must be logged in to reply to this topic.