ThemeShaper Forums » Thematic

[closed]

1 column layout on specified pages

(4 posts)
  • Started 8 years ago by friendlygiraffe
  • Latest reply from friendlygiraffe
  • This topic is not resolved

Tags:

  1. Hi, I am using a standard 2 column '2c-r-fixed' layout with a sidebar

    Is it possible to have a full-width 1 column layout on specific pages? IE: on the home page I want the #content div to span full width ?

    Thanks

    Posted 8 years ago #
  2. You'll need to slightly change this on your functions.php

    // filter thematic_sidebar() ... switch off on static home page
    function remove_sidebar() {
     // We test if we are on the front page
     if (is_front_page() and !is_home()) {
     // Yes, we are .. now we switch off the sidebar
     return FALSE;
     } else {
     // we are not .. we leave the switch on
     return TRUE;
     }
    }
    // Connect the filter to thematic_sidebar()
    add_filter('thematic_sidebar', 'remove_sidebar');

    and maybe your style.css might need a slight modification to. Little more information in one of Chris's posts here; http://programming.thematic4you.com/2010/01/how-to-remove-the-sidebar-from-a-certain-page/

    Posted 8 years ago #
  3. neonbible
    Member

    Create a new page template file for full width page. And when you create a new page in WP-admin you can specify which template it uses.

    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    Or use the existing ones from thematic as an example.

    Posted 8 years ago #
  4. Thanks I got it with this:

    function add_wide_class($class) {
    global $post;
    if ( is_page('next-show') ) {
    $class<> = 'wide-page';
    }
    return $class;
    }
    add_filter( 'body_class', 'add_wide_class' );

    // Remove sidebar on selected pages
    function remove_sidebar() {
    global $post;
    if (is_page('next-show')) {
    return FALSE;
    } else {
    return TRUE;
    }
    }
    add_filter('thematic_sidebar', 'remove_sidebar');

    But when I use this function, to display the categories on one page, the sidebar appears again. Do you know why this is?:

    // display categories on pages
    function childtheme_second_loop() {
    if (is_page('next-show')) {
    query_posts("category_name=next-show&showposts=10");
    thematic_index_loop();
    return;
    }
    }
    add_action('thematic_abovepagebottom', 'childtheme_second_loop');</code

    Posted 8 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.