ThemeShaper Forums » Thematic


How to hide an element on certain pages?

(2 posts)
  • Started 10 years ago by photoman
  • Latest reply from em hr
  • This topic is not resolved
  1. photoman

    I'm creating my first child theme and trying to figure out the easiest way to hide the post title on pages but not on posts.

    At the moment I'm using the css:
    h1.entry-title {
    display: none;

    The problem with this is it hides the entry title on every page and post on my site. It would be great to be able to do this just with css as it would be better for SEO but if the only way is to remove the entry title on pages with an action hook then I'd be ok with that.

    Does anyone know how I would do this?

    Thanks for your help.

    Posted 10 years ago #
  2. Use the dynamic body class. Look at the source of the page that you want the title removed from. Pick a body class name that is specific to the desired part of your site.

    Prepend the css declaration with the bodyclass like so:

    .s-category-uncategorized h1.entry-title {
    display: none;

    That will remove it for all single post views that are in the uncategorized category

    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.