ThemeShaper Forums » Thematic

[closed]

Alternate CSS for Posts

(2 posts)
  • Started 9 years ago by dpipitone
  • Latest reply from Devin
  • This topic is not resolved

Tags:

  1. I currently have a custom CSS file working for Pages, using some of the info I have found on this forum, but I am also interested in pointing to this same alternate.css file for POSTS. In other words, I would like the posts to have the same exact format/template as the PAGES.

    The current code I have pointing the pages to the alternate css is:

    function my_stylesheet($content) {
      global $wp_query;
      if (is_page()) {
        $pageID = $wp_query->post->ID;
        $pagelist = array('5','3','334');
        if (in_array($pageID, $pagelist)) {
            $content = "\t";
            $content .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"";
            $content .= get_bloginfo('stylesheet_directory') . "/alternate.css";
            $content .= "\" />";
            $content .= "\n\n";
            }
        }
        return $content;
    }
    add_filter ('thematic_create_stylesheet', 'my_stylesheet');

    Is there a way for me to alter this to also point posts in a given category to the same alternate.css file?

    Thanks!

    Daniel

    Posted 9 years ago #
  2. You could take a look at this thread and just have the conditionals go straight in the code. I know that's not exactly what you're asking, but it would work:

    http://forums.themeshaper.com/topic/styling-individual-pages

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.