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
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
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);