user1847224
user1847224

Reputation:

Echo page description from Yoast on wordpress

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

Upvotes: 1

Views: 3629

Answers (3)

MediaFormat
MediaFormat

Reputation: 377

wpseo_get_value('metadesc'); has been deprecated

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

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

Upvotes: 1

Leandro Dimitrio
Leandro Dimitrio

Reputation: 112

You can use

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

Upvotes: 1

Sabari
Sabari

Reputation: 6335

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

Upvotes: 0

Related Questions