The wp_title() check conflicts with how _s handles title tags
-
On a fresh Underscores-based theme, Theme Check gives the following error:
REQUIRED: The <title> tags can only contain a call to wp_title(). Use the wp_title filter to modify the output
The function on these lines of code are what’s causing it.
function _s_render_title() { echo '<title>' . wp_title( '|', false, 'right' ) . "</title>\n"; }
I believe this is a similar issue as outlined here and here.
This block of code is also slated to be removed in 4.3 from _s completely in favor of
add_theme_support('title-tag')
after it’s introduced in 4.1.When that happens, Theme Check will throw the following error:
REQUIRED: The theme needs to have <title> tags, ideally in the header.php file.
I know I can get around this for now by just putting the <title> tag directly in the header.php file, but seeing as more and more themes will be using
add_theme_support('title-tag')
and the pre-4.1 shim as used in _s, I think it’s worth considering revising this check.
- The topic ‘The wp_title() check conflicts with how _s handles title tags’ is closed to new replies.