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.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.