php short code in Title, Metatags
-
Hi,
I want to pull the title, metatags from a database using a function. I have written the PHP short code using a plugin and it can bring in the title etc.
However, when I type the PHP shortcode in the title tag of the page, it is output as it is…. and not the value from the php shortcode.The PHP short codes work in the body content of the page, but not in the title and description fields of the page. Please advise if I need to use any other plugin, or tweak from the functions.php for the generatepress child theme.
I also tried this in the functions.php of child theme, just to test it. However, nothing was output in the title.
add_filter( 'wp_title', 'filter_pagetitle', 10, 2 );
function filter_pagetitle() {
return "myunique title";
}
Any help or suggestions is much appreciated! Thanks.
- The topic ‘php short code in Title, Metatags’ is closed to new replies.