WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Hide specific page title on twentyten theme (17 posts)

  1. greenpeas
    Member
    Posted 3 years ago #

    on my site, I'd like to hide the page title on the main page.... I tried adding this to childtheme:

    .parent-pageid-415 #content .entry-title {
    display: none;
    }

    with no avail. Any ideas?

  2. alchymyth
    Forum Moderator
    Posted 3 years ago #

    imho, there is no css class .parent-pageid-415 on that page;

    there is a body class .page-id-415 and a post class .post-415

    are you talking about the 'Welcome to Oakland Structures' title?

  3. greenpeas
    Member
    Posted 3 years ago #

    ummm, yes!

    I am currently working on adding a sliced photoshop file to that page, so it may look a little weird at time of this writing

  4. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    First: you need to use .page-id-415, rather than .parent-pageid-415.

    Second: you're probably better off targeting body.home, rather than body.page-id-415.

  5. greenpeas
    Member
    Posted 3 years ago #

    That worked Chip, thank you.

    well, the first one, so, I guess does it matter the method of your 2 suggestions?

  6. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    It only matters if the Page ID changes, which could happen if you use a different Static Page as your front page, or perhaps if you had to restore from backup, and the Pages got assigned different IDs in the database.

    Using body.home is also more semantic, as it better explains where/why you want the Page Title not to display. So, it will be easier to understand/follow in the future, when you (or someone helping you?) might not remember why body.page-id-415 has its Title set not to display.

  7. greenpeas
    Member
    Posted 3 years ago #

    That makes sense,

    How would I implement that instead of:

    }
    .page-id-415 #content .entry-title {
    display: none;

    like this?:

    }
    .body.home #content .entry-title {
    display: none;
  8. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    That should work, yes - except body is a tag, not a class:

    body.home #content .entry-title {
         display: none;
    }
  9. greenpeas
    Member
    Posted 3 years ago #

    actually, this worked:

    }
    body.home #content .entry-title {
        display: none;

    Thank you very much!!!

  10. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Glad to help, and glad you got it working!

    (p.s. be sure to mark the Topic as "Resolved".)

  11. wildwood
    Member
    Posted 3 years ago #

    How do I find the page ID numbers?

  12. greenpeas
    Member
    Posted 3 years ago #

    I use the plugin Reveal IDs for WP Admin
    It works great!

  13. alchymyth
    Forum Moderator
    Posted 3 years ago #

    in the dashboard - in the 'posts' page -
    when you hover over the post name, you get the permalink in the address window at the bottom of the browser;
    something like:

    yoursiteurl/wp-admin/post.php?post=1234&action=edit

    where this number 1234 is the post ID.

  14. esmi
    Forum Moderator
    Posted 3 years ago #

  15. wildwood
    Member
    Posted 3 years ago #

    Okay, I just found an amazing solution. I called a programmer friend and he had a solution that WORKS.

    Open the "loop-page.php" file in the theme. In the code that says:

    <?php if ( is_front_page() ) { ?>
    <h2 class="entry-title"><?php the_title(); ?></h2>

    Remove (or comment out):
    <h2 class="entry-title"><?php the_title(); ?></h2>

    BINGO!..... title for the Home page (or entry page) is gone from the page, but remains in the navigation.

  16. Olly - OWMC
    Member
    Posted 3 years ago #

    does anyone know what are the effects on SEO when you hide specific page titles? ta.

  17. wildwood
    Member
    Posted 3 years ago #

    Good question, Olly. Actually on this thread I think we were mostly all wanting to hide the title on the "home" page. The word "home" would not be a key word that one would need to optimize, so it would have no effect on the SEO.

Topic Closed

This topic has been closed to new replies.

About this Topic