Remove Page Titles

  • qdevsuite

    #5094

    Hi All, My question is on removing page titles. I know you can remove them using the custom CSS

    .post-title, .post-title a, .post-title a:visited {
    display: none;
    }

    But now if I click on a parent page which lists all the sub pages underneath I lose the page titles which I want to keep.

    Any idea how I can amend the CSS to keep the page titles when a parent page is selected, and remove the title when a page is opened.

    Hope this makes sense.

    Thanks

    Josh

    #30656

    Provide me with the two links showing both pages; the “actual page” and it’s “parent page”.

    qdevsuite

    #30657

    Here are the links. I currently have the option for page titles switched off

    Link to a page

    http://wp.qdevsuite.com/controls/qribbon/

    Link to the parent

    http://wp.qdevsuite.com/controls/

    Josh

    #30658

    Okay. Go ahead and re-enable the page titles again.

    We are probably going to have to use a conditional in php to check if the page being rendered is a single page. Something like:

    if (is_page()) {
    ?><style type="text/css"> <!-- .post-title, .post-title a, .post-title a:visited {display: none;} --></style><?php
    }

    Are you using a child theme?

    Mod

    Kenneth John Odle

    #30659

    Maybe

    .single .post-title,
    .single .post-title a,
    .single .post-title a:visited {
    display: none;
    }

    ?

    Josh

    #30660

    Good call, Ken. I modified my code above. is_single() is for a post, while is_page() is for a page.

    So, using the same logic… this might work just using css:

    .page .post-title,
    .page .post-title a,
    .page .post-title a:visited {
    display: none;
    }

    Not sure… but definitely easier than custom php.

    qdevsuite

    #30661

    Thanks Josh, but the CSS code displays the page title in both the page and Child pages.

    Prasanna SP

    #30662

    Try this,

    .post-title, .post-title a, .post-title a:visited {
    display: none;
    }

    .child-page .post-title, .post-title a {
    display: block !important;
    }

    qdevsuite

    #30663

    Sorry no that didn’t work. The pages titles are all there still. Thanks Prasanna

    ronangelo

    #30664

    try this to remove non-link post titles

    .post h1 {
    display: none;
    }
Viewing 10 posts - 1 through 10 (of 16 total)

You must be logged in to reply to this topic.