Get Yoast og:title into variable inside functions.php
-
I am trying to get the og:title which is set in Yoast product category.
I have not found any solution (2 posts I found are deprecated several years ago) or function that gets a yoast variable.
Is it even possible?
My current code in functions.php:
function my_new_title(){ if( is_product_category() ) { $ogtitle = "how to get og:title from yoast here"; echo "<h1>".$ogtitle."</h1>"; } }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Get Yoast og:title into variable inside functions.php’ is closed to new replies.