I am trying to add meta titles via the Yoast SEO plugin.
My theme is not compatible with this -- the resulting <title>
tag is a concatenation of the Yoast title and the theme's title.
One solution is to ensure the <title>
tag in header.php
is set to <?php wp_title(''); ?>
(see Yoast article here -- section "Themes without title-tag Support").
This method works (I tested it), and is also the solution suggested to me by my theme devs. But how can I do this via a custom function in my child theme's functions.php, rather than editing header.php?
I realize one possible solution is to copy header.php from parent theme to child theme, then edit that file. But I’m trying to avoid that if possible.
I tried the answer given in this previous question, but all that did was add a second <title>
tag to the page, in addition to the existing, incorrect <title>
.