• arth

    (@arth)


    Hello,

    I am trying to hide the page title on a single static page while keeping it in the menu by using CSS. I have found many similar topics on this forum but none of the solutions seems to be working for me. I am using the theme Revolution Code Blue. The style sheet has the following id (which I have already edited slightly):

    #content h1 {
    color: #2255AA;
    background: #F1F1F1;
    font-size: 24px;
    font-family: Times New Roman, Georgia, Trebuchet MS;
    font-weight: normal;
    margin: 0px;
    padding: 0px 3px 0px 0px;
    border-bottom: #CCCCCC solid thin;
    }

    When I add ‘display: none;’ to it, the page titles on all pages disappear (as expected).

    I have tried using ‘#page-id-29 .h1 {display: none;}’
    and different variations thereof to hide it on a single page but to no avail.

    I am new to both WordPress and CSS so would appreciate any help. I guess I am missing some small but vital detail.

    Thanks a lot to everyone in advance.

    P.S. I presume it would help if I posted the link to the site but it is not live yet and runs only on MAMP. Do let me know if you need more information.
    I have also double-checked the page id and it is definitely 29.

Viewing 10 replies - 1 through 10 (of 10 total)
  • peredur

    (@peredur)

    It’s very hard to help without a link to the site, but you seem to me to be in the right direction.

    The more precise CSS you tried is not valid and that’s probably why it didn’t work. You have:

    #page-id-29 .h1 {
      display: none;
    }

    A full stop in a selector in CSS denotes a class. I don’t think that’s what you want.

    If you want to supress h1 display on any h1 element that is a descendent of any element with the id page-id-29, then the selector you need is:

    #page-id-29 h1

    (Note no full stop)

    If you want to suppress the display of h1 elements that have an id of page-id-29, you want:

    h1#page-id-29

    HTH

    PAE

    Thread Starter arth

    (@arth)

    Thanks a lot Peredur,

    I have tried both of your suggestions but still no luck, I’m afraid.
    Maybe I’ll wait until the site is live and post the link here.

    peredur

    (@peredur)

    Yes. Do that.

    I always develop on live sites. OK, I put them behind a ‘Maintenance Mode’ page, but you can always take maintenance mode off, temporarily, if you need others to access the site to help with a problem.

    And I find transferring sites a pain, TBH.

    Cheers

    PAE

    Thread Starter arth

    (@arth)

    Yes, I am not looking forward to transferring the site either. May try the Maintenance Mode in the future. Thanks again

    yelhca07

    (@yelhca07)

    I have an easy fix for this, that might not be great, but it works. I didn’t want my homepage to have the “home” header but I wanted to keep it in the navigation. So I saved my page without a name. Then I added it to the navigation and simply renamed the label to home. Works!

    peredur

    (@peredur)

    I didn’t suggest that because of what it might do to the permalink. But my worries were obviously unfounded.

    Cheers

    PAE

    Thread Starter arth

    (@arth)

    Ok, so far so good. Saved the page without the name and the title disappeared but not sure how to add it back to the navigation.

    yelhca07

    (@yelhca07)

    Well — depends on how permalinks are structured– and I edited the permalink to be custom on that page. To add back into the nav just drag in the page with the blank page name and click the little arrow to rename the Label associated with it.

    Thread Starter arth

    (@arth)

    Hmm, still no luck. But that’s probably just me being blind. I think I might wait until I have the site up and running and then post a link here otherwise we’ll be just stabbing in the dark :). Thanks again for your help!

    yelhca07

    (@yelhca07)

    Let us know!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Hide title on single static page’ is closed to new replies.