WordPress.org

Ready to get started?Download WordPress

Forums

Removing Title on Single Page (9 posts)

  1. TaylorReints
    Member
    Posted 1 year ago #

    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.

  2. 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.

  3. TaylorReints
    Member
    Posted 1 year ago #

    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.

  4. 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.

  5. TaylorReints
    Member
    Posted 1 year ago #

    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.

  6. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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;
    }
  7. TaylorReints
    Member
    Posted 1 year ago #

    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.

  8. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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...

  9. TaylorReints
    Member
    Posted 1 year ago #

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags