Incorrect usage of add_theme_support( 'title_tag' ) and wp_title()
-
This theme and at several others of yours have both
add_theme_support( 'title_tag' )
in functions.php and awp_title()
call in the header.php file. As of WordPress 4.4,wp_title()
is somewhat deprecated and including it while also adding theme support for title tags results in, in some cases, empty title tags. This is obviously very bad for a number of things, especially SEO.The point of adding theme support for title tags is, essentially, acknowledging that the theme doesn’t include them via
wp_title()
. Even thoughwp_title()
ended up being un-deprecated for 4.4, keeping that unconditionally is now causing empty title tags to be rendered whenadd_theme_support( 'title_tag' )
is also called. Specifically, I’m seeing an empty title tag followed by the correct one when logged in, but Chrome at least is using the first (empty) one. When not logged in, it seems to be giving the page title and a separator but missing the site title after the separator. Core could probably improve the way it handles this, but bottom line, the usage is incorrect in this theme. Any calls towp_title()
should be removed from your themes’header.php
files as soon as possible, since most average users will not realize that their title tags are broken.For reference: https://make.www.ads-software.com/core/2014/10/29/title-tags-in-4-1/, https://make.www.ads-software.com/core/2015/10/20/document-title-in-4-4/, https://make.www.ads-software.com/themes/2015/08/25/title-tag-support-now-required/.
I did a quick check of around five of your themes and only one (Wilson) had the correct usage (your themes are superb, by the way, I make most of them available for users on the multisite networks I run).
- The topic ‘Incorrect usage of add_theme_support( 'title_tag' ) and wp_title()’ is closed to new replies.