Archived topic
How can I add post meta description above Featured Image?
3 replies · Started by Naman on December 14, 2021
Please help me to add post meta description or first paragraph above the featured image (for all posts)
Like: https://prnt.sc/2325ajw
Position: Just below title and above Featured image.
Thanks in advance!
Hi there,
You can hook the description on generate_after_entry_title.
Example:
add_action('generate_after_entry_title', function(){
if( is_single() ){
//do your description code here
}
},1);
You then modify the code to display the description within the condition clause.
If you can tell us what the source of the description is or how you input the description, we can help w/ the code writeup to make it display. :)
So, Do I have to use shortcode if I'm using Yoast SEO to display post meta description?
I want to add either the first Paragraph of the article or the meta description (Yoast SEO)
Btw, Thanks for your response.
If Yoast SEO has a shortcode for it then you can use that.
Example:
add_action('generate_after_entry_title', function(){
if( is_single() ){
echo do_shortcode( '[your shortcode goes here]' );
}
},1);