ThemeShaper Forums » Thematic

[closed]

Removing Sidebar

(16 posts)
  • Started 9 years ago by napalm
  • Latest reply from em hr
  • This topic is resolved

Tags:

  1. Hi All,
    Just wondering if someone could advise on how I can remove the sidebar from certain pages.

    Say for instance I do not want the sidebar to show up on the Home page and About page.
    Is there some way i to tell page.php to check what page the user is on before grabbing the side bar ?

    e.g.

    <?php
    if (!home || !about)
    thematic_sidebar();
    ?>

    Thanks in advance

    Posted 9 years ago #
  2. Justin
    Member

    This is some where in the forum. In the interest of time use the following code in the functions.php used by your child theme:

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

    someotherpage can also be specified as a page id number too I believe.

    Good luck!

    Posted 9 years ago #
  3. Thats perfect! Thanks Justin!

    Posted 9 years ago #
  4. This works great. But how do you now use the space that the sidebar use to take up?

    Posted 9 years ago #
  5. Ive tried adding this to style.css but it doesnt work.

    body.slug-gallery #container {
    width: 960px;
    }

    body.slug-gallery #content {
    width: 940px;
    }

    Posted 9 years ago #
  6. Hi,

    if you would include the CSS snippets as listed above it would work :)

    You included:

    body.slug-Gallery #container {
    width: 960px;
    }
    
    body.slug-Gallery #content {
    width: 940px;
    }

    Chris

    Posted 9 years ago #
  7. Hi Chris,

    Sadly that snippet doesnt work for me. Ive added it to my child template style.css file. Is this correct?

    Cheers
    Mike

    Posted 9 years ago #
  8. Hi Mike,

    "Trust in me, just in me
    Shut your eyes and trust in me"

    :)

    Use:

    body.slug-gallery #container {
    width: 960px;
    }
    
    body.slug-gallery #content {
    width: 940px;
    }

    Don't use:

    body.slug-Gallery #container {
    width: 960px;
    }
    
    body.slug-Gallery #content {
    width: 940px;
    }

    I tried it with Firebug and your blog. The 'G' should be a 'g'.

    Chris

    Posted 9 years ago #
  9. I swear I tried that. But I must admit I refreshed with a ctrl+shift+refresh, which bypasses system cache. And vola! It worked. Champion. Thanks.

    Posted 9 years ago #
  10. A couple more questions.

    1. How do I work out the name of each page? Is it pre-defined somewhere?
    2. How do I include other pages in the CSS? Or do I copy the code and just edit "body.slug-gallery" to the respective page name?

    Cheers in advance.

    Posted 9 years ago #
  11. menegheto
    Member

    >"Trust in me, just in me
    >Shut your eyes and trust in me"

    Well I do, but that css snippet works if I call "2c-r-fixed" and doesn't work if I call "2c-l-fixed". Didn't dig in to understand why...

    Cheers
    Alessandro

    [edit]

    seems to work this way (if 2c-l-fixed is loaded)

    body.slug-[your] #container {
        float:left;
    width: 960px;
        margin: 0;
    }
    
    body.slug-[your] #content {
        margin:0 0 0 10px;
    width: 940px;
    }
    
    body.slug-[your] .hentry {
        width:940px;
    }
    Posted 9 years ago #
  12. Hi,

    that's right. My original post http://www.wupperpiraten.de/2009/03/how-to-remove-the-sidebar-from-a-certain-page/ is only talking about the 2c-r-fixed layout.

    Chris

    Posted 9 years ago #
  13. Wonderful code, however it does not work on my static "home" (index) page. Is there a workaround?

    Posted 9 years ago #
  14. kim.vanmelckebeke
    Member

    Can this be done for the search result page?

    This does'nt work:
    body.slug-search #container {
    width: 960px;
    }

    body.slug-search #content {
    width: 940px;
    }

    Posted 9 years ago #
  15. orionmessier42
    Member

    bump - This doesn't seem to work for the home page. Is there a trick here I'm missing?
    I'd like to change the bg image on the #container that appears on the home page only.

    Thanks!

    Posted 9 years ago #
  16. Try:

    .home #container {background:red}

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.