ThemeShaper Forums » Thematic


Alternate CSS for Posts

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


  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?



    Posted 11 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:

    Posted 11 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.