My WordPress site's title not showing. It's just displaying the domain like, www.example.com.
Please suggest how to display the proper title tag.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityAdd this code to your functions.php
if ( !function_exists( 'yourtheme_setup' ) ) {
function yourtheme_setup() {
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
}
add_action( 'after_setup_theme', 'yourtheme_setup' );
}
Or, if your functions.php already have after_setup_theme
, just add the line add_theme_support( 'title-tag' );
into your after_setup_theme
. (Source)