Use Meta description in template (loop)
-
Hello,
I can’t seem to figure out how to use the _aioseop_description (auto-generated) in my template. I saw some answer everywhere but none seems to be working.
I have activated the social extension to get Open Graph.
On some pages I have created share buttons.
I would like to add something like:
<?php $og_description = get_post_meta($post->ID, '_aioseop_description', true); ?>
To use that variable in my sharer’s url, for example for twitter:
<li class="twitter"><a target="_blank" href="https://twitter.com/intent/tweet?url=<?php echo $og_link; ?>&text=<?php echo $og_description; ?>&via="><span class="socicon_twitter"></span></a></li>
It works for title, url… but can’t get to retrieve the meta description.Any ideas?
Best regards,
Quentin
- The topic ‘Use Meta description in template (loop)’ is closed to new replies.