ThemeShaper Forums » Thematic

Single column width for posts

(2 posts)
  • Started 13 years ago by ghp
  • Latest reply from ghp
  • This topic is resolved
  1. ghp

    This is my first post here and so far I'm really enjoying working with Thematic!

    What I'm trying to do:

    • create a child theme based on 2c-r-fixed.css
    • all of the site will have the sidebar, except posts, which will be single column, with the full 960 (940) width
    • I'd be happy to add a function / filter to the child theme's functions.php or set up alt style sheets for the child theme but I can't get it to work yet

    What I've tried

    • adapting instructions from here: How to remove the sidebar from a certain page? - this is for a single page and I can't figure out how to adapt it to apply to all posts (i.e. is_single())
    • hopelessly and fruitlessly messing around with template files by copying over header.php into the child theme folder - is there some filter I can add to thematic_body_class() that applies only to single posts?
    • from this post : How do I define a custom CSS file per page template? I tried to define an alternate css file that's similar to style.css but does not import 2c-r-fixed.css but instead includes definitions for #container and #content to be 960 and 940 px. I couldn't get this to work, I think partly because I don't know how to set up the directory structure to correspond with this part of the code:

    $content .= get_bloginfo('stylesheet_directory') . "/alternate.css";

    I know there's an easy solution to this but I'm stumped!

    Thanks in advance!

    Posted 13 years ago #
  2. ghp

    After taking a break and coming back to dig around the forum some more I found this:
    Sidebar Content Sidebar Layout

    Adding the following code to my child theme functions.php file got it working as intended Phew!

    function my_stylesheet($content) {
    if (is_single()) {
    $content = "\t";
    $content .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"";
    $content .= get_bloginfo('stylesheet_directory') . "/styles/alternate.css";
    $content .= "\" />";
    $content .= "\n\n";
    } else {
    $content = "\t";
    $content .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"";
    $content .= get_bloginfo('stylesheet_directory') . "style.css";
    $content .= "\" />";
    $content .= "\n\n";
    return $content;
    add_filter ('thematic_create_stylesheet', 'my_stylesheet');

    Posted 13 years ago #

RSS feed for this topic


You must log in to post.