Support » Fixing WordPress » Posts page header text doesn’t match

  • On my Posts page, the page-title ‘Posts’ does not match the page-titles for my other pages. I can see in the source code, it shows as:

    <h2 class=”page-title”>Posts</h2>
    </header><!– .entry-header –>

    Where for my other pages, it shows as h1:

    <h1 class=”page-title”>Blog</h1>
    </header><!– .entry-header –>

    Problem one is that I don’t know which file the above code is coming from in order to edit it.

    Problem two is that the Posts page-title is the wrong color. When I go to the Dashboard, Appearance, Customize, Colors, Header, Hero Text, I can change the Hero Text color for the Blog page for example, and it will change the text color in the header. But when I try to do this for the posts page, the color already shows as white there, yet the word ‘Posts’ shows as gray. I would be grateful if anyone could help me with either or both of these questions. Thanks!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Anil Ankola

    (@anilankola)

    Hi, @danwestlund

    use this function and Place this code in the functions.php (use a child theme).

    function modify_all_titles($title, $id) {
      return '<h1 class="page-title">'.$title.'</h1>';
    }
    add_filter('the_title', 'modify_all_titles', 10, 2);
    
    danwestlund

    (@danwestlund)

    Hi Anil. I appreciate the help. Unfortunately this didn’t work for me. I went into the theme I’m using and added this code to functions.php. If you go back and check my page, danielwestlund.com, it added some of this code as text in the title, like h1 class etc. However, while it did this to all my normal page titles, it didn’t touch the ‘Posts’ title, so that seems to be coming from somewhere else.

    Anil Ankola

    (@anilankola)

    Hello, @danwestlund

    please remove above function on functions.php and use CSS code on style.css file font-color, family, size etc…

    body.single .hero header.page-header h2.page-title {
    	color: #fff;
    	font-family: "Oswald", sans-serif;
    	font-size: 3em;
    	line-height: 1.2;
    }
    
    danwestlund

    (@danwestlund)

    Thanks again. While that does not hurt the normal Pages, it didn’t change that ‘Posts’ title. It’s a needle in a haystack. I can find several ways to change the title appearance on normal Pages, but for that Posts page, while I can change the titles of the posts themselves, I can’t find where those small, gray ‘Posts’ text settings are coming from.

    Thought I’d update here. I got a new laptop and decided I was going to tackle this again. When I pulled up this page in Chrome, the Posts header looked correct:

    http://danielwestlund.com/story-inception/

    I’m using the same version of Chrome as before. Perhaps one of your suggestions worked, and it was pulling the old page from cache or something. Thanks for the help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.