Support » Plugins and Hacks » ReciPress » [Plugin: ReciPress] Meta Description
4 years, 7 months ago
After applying this plugin, all my posts have no meta description..
Is there any way to call the $summary of the recipe to be used in head as <meta description ???
In your meta field you can use this function:
<?php echo recipress_recipe('summary'); ?>
I haven’t tested this, though.
4 years, 6 months ago
Thanks for your help!
I tried this:
<meta name=”description” content=”<?php echo recipress_recipe(‘summary’); ?>”/>
But this outputs the <p summary> tag too! and the second problem is that it echos the summary in the top of my page.
hmmm.. Then I suppose I need to rework how my functions output their information. I hadn’t anticipated this kind of issue. Thank you for your input, I will throw it int he hat for the next update. For now, this should do what you want:
$summary = get_post_meta($post->ID, 'summary', true);
if(!$summary) $summary = recipress_gen_summary();
else $summary = $summary;
<meta name="description" content="<?php echo $summary; ?>"/>