Requirements¶
Theme Requirements¶
Metadata Generation¶
Add-Meta-Tags uses the wp_head
and wp_footer
action hooks to embed metadata to the HTML HEAD and the HTML BODY. Therefore, it is essential that your theme includes these two action hooks in its templates.
Custom Post Title¶
For this feature to work properly, it is required that no extra processing of the title takes place inside the theme templates.
If extra processing takes place, like it happens in the TwentyEleven theme, then, posts with custom titles appear having a title like <Post-Title><Site Name>
(without a separator). In such cases, it is required to add the following code in the theme's functions.php
file as a workaround:
function amt_custom_title_modified( $title ) {
if ( ! empty($title) ) {
return $title . ' | ';
}
}
add_filter( 'amt_custom_title', 'amt_custom_title_modified');
Advanced Title Management¶
For this feature to work properly, it is required that no extra processing of the title takes place inside the theme templates.
Themes, in which the generation of the <title>
HTML element is implemented as a theme feature with the following statement inside the functions.php
file, for example the TwentyFifteen theme, should work out of the box:
add_theme_support( 'title-tag' );
Themes, in which the <title>
HTML element is populated only with the use of the wp_title()
function inside the header.php
template as shown below, for example the TwentyFourteen theme, should work out of the box:
<title><?php wp_title( '|', true, 'right' ); ?></title>
Themes, in which the <title>
HTML element is populated with the use of the wp_title()
function plus extra PHP code inside the header.php
template, like it happens in the TwentyEleven theme, do not work as expected and need to be customized to generate/populate the <title>
HTML element using one of the methods outlined above.