This topic has 7 replies, 2 voices, and was last updated 7 years by Laura.

  • Author
  • #195900
     Grant
    Participant

    Hi Guys,

    How can I remove the ‘Page Title’ from Pages only – but not Posts?

    The navigation I have on the site is pretty intuitive. I’ve already removed the breadcrumb. There is also just no need to display the page title. It takes up unnecessary visual space on mobiles.

    I know I can go from page to page and edit the ‘Title’ settings on every page but that does not remove the page titles for pages like Archives, Catagoriies, Tags, etc.

    I’m sure there’s probably a bit of php code there somewhere in the Theme which can just be removed.

    Cheers,

    Grant

    #195966
     Laura
    Moderator

    Hello, please add this to style.css of child theme 🙂

    COPY CODE
    
    .page .page-title {
        display: none !important;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #195992
     Grant
    Participant

    Hi Laura,

    Thanks for your reply. However, that option won’t work. Using it removes BOTH the tag and post headings. Notice in the attached files that the CSS path names are effectively the same.

    The only way I can see that it will be possible to remove the ‘Tag Heading’ but without touching the ‘Post Heading’ is to remove the relevant php code from the appropriate file and place that file in the Child theme location. Unless you can think of a different workaround?

    Do you know which file generates the Tag and Catagory headings?

    Cheers,

    Grant

    #196036
     Laura
    Moderator

    Hello, yes i can find a workaround with css, can you share access so i can test it? 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #196045
     Grant
    Participant

    Sure Laura,

    By all means, please give your idea a shot.

    I’d prefer to implement a CSS workaround rather than have to implement an unnecessary php code hack or a new custom field. I always try to avoid changing core files where possible.

    If your idea works, the Post Title below should still display BUT the tag archive ‘Tag Archive for: Global Cooperation’ and category archive ‘Archive for category: Unity’ page titles should both be hidden from display.

    You can use this draft post for testing.

    Draft Post

    https://www.ihoearth.com/?p=6153&preview=true

    You can use this temp account and password to access the site.

    email – itxp@hotmail.com
    password – a1$23h62ba%

    Thanks Laura – Your support is appreciated. I’m usually pretty good at finding some kind of workaround (even if it takes hours), but due to the CSS hierarchy for the Post, Category and Tag titles being the same here, this one has me stumped. I can’t see how to differentiate one title from the other in this case.

    Cheers,

    Grant

    #196136
     Laura
    Moderator

    Hello, here is the idea, let me know if it works

    COPY CODE
    
    .category h1.page-title {
        display: block !important;
    }
    .tag h1.page-title {
        display: block !important;
    }
    h1.page-title {
        display: none;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #196161
     Grant
    Participant

    Hi Laura,

    Thanks so much for your efforts.

    The code above was not quite what I was after however it gave me the necessary info that I needed to tweak it to achieve the result. So THANK YOU!

    I wanted to remove the category and tag titles ONLY while leaving the Post Title. A little tweak of the above and that worked!

    THANKS,

    Grant

    #196184
     Laura
    Moderator

    Glad you could resolve it 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?