How to display custom seo title before the loop?

So I’ve optimized one of my archive page title to this

add_filter(‘wpseo_title’, ‘new_filter_title’);

function new_filter_title($title)

// with all the custom stuff here

return $title;`

and this works perfectly. So what I’m trying to do now is echo the same title in the page before the loop. how do I this?

I’ve already tried this solution

echo get_post_meta(get_the_ID(), ‘_yoast_wpseo_title’, true);

That didn’t work. it instead returned variables %%title%% ……..%%sitename%%

Read more here:: How to display custom seo title before the loop?

Leave a Reply

Your email address will not be published. Required fields are marked *