ThemeShaper Forums » Thematic


adding custom post type as a css selector for body tag

(7 posts)
  • Started 9 years ago by slambert
  • Latest reply from butters81
  • This topic is not resolved
  1. I just converted some category posts to a custom post type. I'd like to style these using a selector in the body. Right now the post_type isn't appearing in the list of body selectors.

    Is this because I converted them? Is there code I can add to functions.php to get the post-type in the body class?

    Thanks in advance.

    Posted 9 years ago #
  2. gene just responded to someone else about custom body classes. maybe you can use it too

    Posted 9 years ago #
  3. Try the latest from the svn. It has support for custom post types and taxonomies in the body and post classes :)

    Posted 9 years ago #
  4. woah! Just saw the commit. Nice, thanks!

    Posted 9 years ago #
  5. Hm, still not getting it - thinking maybe because I migrated it over from a standard post?

    Posted 9 years ago #
  6. I'm really not sure. I do know that if it's post_type is either = page or post it will absolutely not show up as intended as a custom-post-type-class in the body or post.

    Posted 9 years ago #
  7. butters81

    hi, I've found that my custom posts do get added to the body class. So for example, I have custom posts for "Newsroom" (although these sit within standard WP categories).

    However, I also have a custom tag taxonomy ("Location"), but this doesn't appear to show up in either the body class or the post classes.

    Is there an easy way of inserting custom tag/category taxonomies into the body classes?

    Many thanks.

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.