Subheader Title is empty

For some reason the pagetitle is not showing in the subheader. The only exception is the blog start page.

The DOM looks like this:

<div id="Subheader"><div class="container"><div class="column one"><h1 class="title"></h1></div></div></div>

But the title itself appears in the title of the browser tab:

<title itemprop="name">Unterricht | Schola Bohemica</title>

link to site with missing title:

http://develop.schola-bohemica.de/de/unterricht/ 

link to site with showing title (blog page)

http://develop.schola-bohemica.de/de/aktuelles/

"Subheader | Hide" in Themeoptions > Header & Subheader > Subheader is unchecked.

Thanks in advance for your help!

Comments

  • Hi,

    please deactivate all your extra plugins because one of them is the culprit for sure.

    Thanks!
  • Thanks for your fast response!

    You are right. It is the Polylang plugin that kills the title on non-blog-pages. I wrote a fix for that:

    1. Copy the header.php to your child-theme folder.

    2. Open the header.php in your child-theme folder and replace the line '<h1 class="title">' . mfn_page_title() .'</h1>' with:

    //fix for Polylang-bug that kills the title
    function is_blog () {
         global  $post;
         $posttype = get_post_type($post );
         return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post')  ) ? true : false ;
    }

    if(is_blog())
    {
         echo '<h1 class="title">' . mfn_page_title() .'</h1>';
    }
    else
    {
         echo the_title('<h1 class="title">','</h1>',false);
    }
    // end of fix

  • Great :) We are happy to see that you found a solution for that.
  • edited February 2016
    Hi.

    Can you please help me with same problem, just on updated Be theme there is content like this :
    (previous lines does not exist in updated theme)


    // Title

    $title_tag = mfn_opts_get( 'subheader-title-tag', 'h1' );
    echo '<'. $title_tag .' class="title">'. mfn_page_title() .'</'. $title_tag .'>';

  • @leonnes Remove all your extra plugins and the problem will disappear.
  • Hi,

    I have only necessary plugins, can you please wrote the fix or just update it, regarding different header.php file

    because the file is not the same now as it was when "TooMuchCoffeeMan " wrote the fix. 

    many thanks
  • @leonnes What your site link then? We are sure that you have plugins that do this. We are 100000% sure that it's not related with theme at all.
  • @leonnes, I had your same problem.
    I fix it replacing the line:

    echo '<'. $title_tag .' class="title">'. mfn_page_title() .'</'. $title_tag .'>';

    with:

    echo the_title('<h1 class="title">','</h1>',false);
Sign In or Register to comment.