ThemeShaper Forums » Thematic

[closed]

condition CSS for posts in specified post type

(5 posts)
  • Started 2 years ago by mrmikeman
  • Latest reply from ScottNix
  • This topic is not resolved
  1. mrmikeman
    Member

    i was able to reomve sidebars for the posts which are of a specific post type, but now i need to increase the width of the content area because, where the sidebar once was, is now just an empty space.

    i know i could make a custom style sheet.. not sure i want to do it that way, is there a way to targets styles for all posts within a specified custom post type?

    all posts in custom post type "books" = #entry-content {width:960px}

    something like that? i know that wouldnt work but thats what im trying to figure out

    thanks!

    Posted 2 years ago #
  2. .single-book #entry-content {width:960px}

    Try that, It should be located in your body tag if you named it different, or it would be different if it was a blog style listing of the CPT.

    You do not need a separate style sheet.

    Posted 2 years ago #
  3. mrmikeman
    Member

    oh snaps man it works! so is "-book" specific for custom post types??

    thanks!

    Posted 2 years ago #
  4. mrmikeman
    Member

    oh snaps man it works! so is "-book" specific for custom post types??

    thanks!

    Posted 2 years ago #
  5. Honestly I haven't really messed with CPT's too much, so I don't know how they work in different areas other than on a single page.

    Just make sure to view source and check your body tag, WordPress will throw a bunch of goodies in the form of a class for you to grab and style.

    <body class="single single-book postid-168 single-format-standard logged-in admin-bar windows firefox ff7">

    .single = single post
    .single-book = single post of book type
    .postid-168 = numeric post id (for getting really specific)
    .single-format-standard = single page of regular post format
    .logged-in = Yes I am logged into my WP
    .admin-bar = for displaying admin bar
    .windows = logged in using windows
    .firefox = using firefox
    .ff7 = using firefox version 7
    .. etc.

    http://codex.wordpress.org/Function_Reference/body_class

    You can do some really powerful stuff with the body class.

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.