i’m developing a theme.
I read there that themes should have the support to title tags declaring it in functions.php. I did so, together with removing any title in head.php, but my index has no title.

My functions.php has this:

add_action("after_setup_theme", "mytheme_setup");

function mytheme_setup () {
    load_theme_textdomain('mytheme');
    add_theme_support( 'title_tag' );
    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size(356, 245);
}

Now header.php, very basic atm

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    <?php endif; ?>
    <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> 
    <?php wp_head(); ?>
</head>

As final note, i should say that not even the way with wp_title() worked. The only way to show something is to put some bloginfo() thing. Any help would be appreciated.

Read more here: add_theme_support( ‘title_tag’ ) is not showing title on index.php


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: