add_theme_support( 'title-tag' )
doesn’t belong in your header template. It belongs in your functions.php
file. Usually, it’s best to wrap it in it’s own function and hook it to after_setup_theme
in order to allow plugins and child themes to override it later if they need to. So…
function wpse_add_title_support() {
add_theme_support( 'title-tag' );
}
add_action ( 'after_setup_theme', 'wpse_add_title_support' );
Once you have declared title support, you can remove the <title>
tag from header.php
altogether and WP will handle putting it in.