ThemeShaper Forums » Thematic

[closed]

Removing sidebar on all but one pages?

(3 posts)
  • Started 10 years ago by yafle
  • Latest reply from em hr
  • This topic is not resolved
  1. yafle
    Member

    Hi Folks

    I am just trying to work out whether it is possible to remove the sidebar on all but one page.

    I am using wordpress as a CMS and don't need the sidebar on any pages except the blog page where it would be useful for the archives etc.

    I have removed it using this function:

    function remove_sidebar() {
    return FALSE;
    }
    
    // Connect the filter to thematic_sidebar()
    
    add_filter('thematic_sidebar', 'remove_sidebar');
    
    function custom_postmeta($postmeta){
     $postmeta = '<div class="entry-meta">';
    
        $postmeta .= '<span class="entry-date"><abbr class="published" title="';
        $postmeta .= get_the_time(thematic_time_title()) . '">';
        $postmeta .= get_the_time(thematic_time_display());
        $postmeta .= '</abbr></span>';
    
        // Display edit link
        if (current_user_can('edit_posts')) {
            $postmeta .= ' <span class="meta-sep">|</span> ' . $posteditlink;
        }
        $postmeta .= "</div><!-- .entry-meta -->\n";
    return $postmeta;
    }
    add_filter('thematic_postheader_postmeta', 'custom_postmeta');
    
    function remove_postfooter() {
    return FALSE;
    }
    
    // Connect the filter to thematic_postfooter()
    
    add_filter('thematic_postfooter', 'remove_postfooter');
    
    // Filter away the default scripts loaded with Thematic
    function childtheme_head_scripts() {
        // Abscence makes the heart grow fonder
    }
    add_filter('thematic_head_scripts','childtheme_head_scripts');

    Am i right in thinking each page can be filtered separately?

    Any Help would be much appreciated.

    Thanks

    Posted 10 years ago #
  2. davidthiel
    Member

    Try a plugin called "Widget Context" ... it allows the conditional display of widgets, so that might accomplish what you're looking for. (e.g. I use it to display some widgets only on home, some only on sub pages, and some only on archives pages). Works with 3.0.

    Posted 10 years ago #
  3. Yes you could do this conditionally.

    function remove_sidebar() {
    	if(is_page()){
    		return FALSE;
    	} else {
    		return TRUE;
    	}
    }
    add_filter('thematic_sidebar', 'remove_sidebar');
    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.