Can i add the itemprop
to the title
element and still use wp_head()
and add_theme_support( "title-tag" )
?
I want to create a theme and get it approved on wordpres.org which uses microdata.
The preceding mean i want the HTML code looks as follows:
<html itemscope itemtype="http://schema.org/WebPage" lang="en-US">
....
<title itemprop="name">WordPress Weblog Theme – Just another WordPress site</title>
....
Now i do not use add_theme_support( "title-tag" )
and use the following code in header.php?
<title itemprop="name"><?php echo wp_get_document_title(); ?></title>
<?php wp_head(); ?>
Now the theme check plugin says:
REQUIRED: The theme needs to have a call to wp_title(), ideally in the header.php file. REQUIRED: The theme needs to have tags, ideally in the header.php file. RECOMMENDED: No reference to add_theme_support( "title-tag" ) was found in the theme. It is recommended that the theme implement this functionality for WordPress 4.1 and above.
<title itemprop="name"><?php wp_title(); ?></title>
?_wp_render_title_tag
from thewp_head
and hook instead a custom version of_wp_render_title_tag
with the title attribute, but I don't think that would be considered best practice for a public theme ;-)