ThemeShaper Forums » Thematic

[closed]

My sidebar won't die!

(6 posts)
  • Started 4 years ago by rlebowitz
  • Latest reply from xxxevilgrinxxx
  • This topic is resolved
  1. rlebowitz
    Member

    I have tried over and over again the following addition to my functions.php in my child theme but my sidebar won't go away! (In this example, I am trying to remove it from the "about" section.)

    **

    // Begin Filtering Display of Thematic Side-Bar
    function remove_sidebar() {
    if (is_page('about')) {
    return FALSE;
    } else {
    return TRUE;
    }
    }
    add_filter('thematic_sidebar', 'remove_sidebar');

    **

    Any advice? Does it have to do with my widgets?

    Thank you!
    Robert

    Posted 4 years ago #
  2. I just did this this week :)

    Can you post a link? Are you using any caching plugins that might need to be cleared? Is it just the 'space' of the sidebar that's still there?

    Posted 4 years ago #
  3. rlebowitz
    Member

    Evilgrin,

    Thanks for your reply. I think the problem was that "about" is a parent page. I fixed it, but no am having trouble with the child pages of "about". In other words, I got rid of the sidebar in the "about" section, but the sub-sections ("biography", "stats", "experience") still have the sidebar.

    My site is: http://polina-such.freehostia.com/about

    I read the post in thematic forums about getting rid of the sidebar in child pages, but it doesn't work.

    Here is my code:

    <?php

    // Begin Filtering Display of Thematic Side-Bar
    function remove_sidebar() {
    global $post;

    if (is_page('photo-gallery') || $post->post_parent == '6' ) {
    // the page is "About", or the parent of the page is "About"

    // Yes, we are .. now we switch off the sidebar
    return FALSE;
    } else {
    // we are not .. we leave the switch on
    return TRUE;
    }

    }
    add_filter('thematic_sidebar', 'remove_sidebar');

    Thank you for any help!
    Robert

    Posted 4 years ago #
  4. ah, I had to filter out the sidebar for a few pages in one of my blogs and did it using the same code, with a small tweak:

    // filter thematic_sidebar() .. no display for the page 'contact','desktops','avatars','siggies', keep it for the rest
    function remove_sidebar() {
     // We test if we are on the page 'contact','desktops','avatars','siggies'
     if (is_page(array('contact','desktops','avatars','siggies'))) {
     // 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');

    the 'array' thing is the change, and that way you can list the many pages that you'd like to change.

    Then you can move on to make the adjustments in the style.css:

    /*remove sidebar from pages*/
    body.slug-contact #container {width: 988px;}
    body.slug-contact #content {width: 988px;}
    
    body.slug-desktops #container {width: 988px;}
    body.slug-desktops #content {width: 988px;}
    
    body.slug-avatars #container {width: 988px;}
    body.slug-avatars #content {width: 988px;}
    
    body.slug-siggies #container {width: 988px;}
    body.slug-siggies #content {width: 988px;}

    You would have to make changes to the widths of course, to suit your theme, but this worked nicely for me. Good luck!

    Posted 4 years ago #
  5. rlebowitz
    Member

    Thank you, Evil Grin!!
    It is working now.

    Posted 4 years ago #
  6. yay!

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.