1
votes

I have installed Wordpress SEO by Yoast onto a site Im building. They have an area when you can add the description for the meta information.

However I want to add this to a twitter meta tag:

<meta name="twitter:description" content="">

Does anyone know how to grab the description and output it for a single page?

Cheers

3

3 Answers

1
votes

You can use

<?php echo wpseo_get_value('metadesc'); ?>
1
votes

wpseo_get_value('metadesc'); has been deprecated

Please use WPSEO_Meta::get_value("metadesc");

<?php echo WPSEO_Meta::get_value("metadesc"); ?>
0
votes

If you need to add twitter:description meta data. Please follow below steps.

 - Login to admin panel
 - Go to menu item SEO->Social
 - Uncheck the checkbox Add Open Graph meta data
 - Go to tab Twitter
 - Check the checkbox Add Twitter card meta data
 - Click on save changes

Now if you visit the post page or any single page, you can see a meta tag with name twitter:description added to the head.

Hope this works for you