• Resolved sioy

    (@sioy)


    I put this bit of code in my child of Twenty Twelve

    /* Remove page title */
    body.home .entry-title {
    display: none;
    }

    It works for the home page (front page as defined in Reading Settings), but if I try and do the same for any of the other pages, the page title remains (changing body.home for say body.contact for my contact page).

    So I guess I need something other than ‘body.home’ in the css for any other pages, but what?

    Sorry my site is still on localhost for a few more days probably.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    .home is taken from the <body> element.

    View your webpage.
    Right click and select ‘View source’.
    Search for “<body” and find the correct class.

    Thread Starter sioy

    (@sioy)

    That’s strange, opened page in Dreamweaver and searched for <body> it gave message: “not found in current document”

    ?

    Thread Starter sioy

    (@sioy)

    The page I want to remove the title next is called “About us”, so I found this in the code:

    <article id=”post-341″ class=”post-341 page type-page status-publish hentry”>
    <header class=”entry-header”>
    <h1 class=”entry-title”>About us</h1>
    </header>

    ought the following be sufficient?

    /* Remove page title */
    body.about-us .entry-title {
    display: none;
    }

    I’ve also tried About-us and about us.

    Not unless “about-us” is a generated class for that page. Try using View Source in your browser to look at the generated HTML code for that page – in the body tag you should see the page specific ID or class you can use in that CSS.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    That’s strange, opened page in Dreamweaver and searched for <body>

    Have you tried searching for “<body“? That’s what I recommended.

    Thread Starter sioy

    (@sioy)

    Thanks guys, with your help I’ve managed to sort it perfectly … this is what I used…

    /* page remove page title (find post id in pages source code and type as page id) */
    .page-id-7 .entry-title {
    display: none;
    }

    thanks guys!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Trying to remove a page title’ is closed to new replies.