Support » Fixing WordPress » Removing Title on Single Page

  • Sorry if this sounds like a newby question.

    So, I am trying to remove the page title of this page. I’ve tried #post-14 h2 {display:none;} in the theme stylesheet. I don’t know, though, if this is the correct stylesheet to put this CSS in, as it is not working.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Christine Rondeau

    (@crondeau)

    Volunteer Forum Moderator

    I don’t think that’s going to work, because the class post-14 is not in your theme.

    Can you add the body class function to your header.php.

    So change

    <body>
    to
    <body <?php body_class();?>>

    Once that’s in place you will have classes you can work with.

    I changed <body> to <body <?php body_class();?>> and then added #post-14 h2 {display:none;} at the bottom of my theme stylesheet, but the title is still there.

    Christine Rondeau

    (@crondeau)

    Volunteer Forum Moderator

    Looking at your HTML source code, I can see this now:
    <body class="page page-id-14 page-template-default custom-background">

    so we can use that in your CSS.
    Try adding the following:

    .page-id-14 . post h2 {
     display:none;
    }

    you don’t have an id <div class=”post”> so that’s why your CSS is not working.

    I kept it, in header.php, as <body <?php body_class();?>> and then removed #post-14 h2 {display:none;} and replaced it with .page-id-14 . post h2 {display:none;}

    It’s still not working, unfortunately.

    There’s a typo in that code — an extra space between the period and the word “post” — it should be this:

    .page-id-14 .post h2 {
     display:none;
    }

    Thank you! It worked.

    But now I have another dilemma. On the Forums page, it says “Posted By Taylor Reints On Sunday, December 9th, 2012 With 0 Comments ยท Edit”

    How would I get rid of this? Thanks.

    This CSS will hide that line of text:

    .pmetasingle {
      display: none;
    }

    Try using Firebug to work with these kinds of CSS issues — it shows you the CSS code that is affecting elements on the page…

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Removing Title on Single Page’ is closed to new replies.