WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Don't display titles on pages (10 posts)

  1. hpgray
    Member
    Posted 1 year ago #

    I am trying to hide the titles on several of the pages on my website. I don't want to delete the reference to the title because I want it to remain there for SEO, but I don't want the title to show on the page.

    Here is one of my pages: http://www.cakeinthemorn.com/categories/

    Any thoughts? I tried adding this code to CSS, but it didn't work...

    .page-id-11 .h1{display: none;}

    Thanks!

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    body.page-id-11 #main-content h1{display: none;}

  3. David Choi
    Member
    Posted 1 year ago #

    The code should be

    .page-id-11 h1 {display: none;}

    removing the data for h1, because it's a tag, not a class name.

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    Esmi's code works just fine.
    Greater specificity improves accuracy of CSS.

  5. hpgray
    Member
    Posted 1 year ago #

    Oh you guys are fast! Thanks! It worked great!

    As a total aside, I seem to have something coded into my theme that outputs my title both as an H1 title and an H2 title. I have no idea why it is like that and I am going to try and remove it--unless it isn't a good idea? Does having the same information in both H1 and H2 create duplicate information for SEO? Why would the theme creators have the title go into both H1 and H2 formats, both displayed at the top?

    Strange...

    Thanks for your help!

  6. rseaver06
    Member
    Posted 1 year ago #

    I've looked all over for this and can't get anything to work. I'm using a child theme and only want to add CSS code to get the title of the page removed. The codes above didn't work when added to my child theme's style.css file. The site is at http://www.tooaks.co/mobilemenu/

    I don't want it to have the "primary content" title.

    Any ideas why the code wouldn't work for me?

  7. David Choi
    Member
    Posted 1 year ago #

    @rseaver06

    Please create a new topic for your problem so someone can help you, because this thread is for supporting hpgray's issue only.

  8. rseaver06
    Member
    Posted 1 year ago #

    Oh, sorry I saw that his problem got resolved so I thought I'd ask here. No problem, I'll create it now, thanks!

  9. David Choi
    Member
    Posted 1 year ago #

    You are welcome!

  10. rseaver06
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic