WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Removing sidebars from single post (4 posts)

  1. ollerwe
    Member
    Posted 4 years ago #

    Hi!

    I want my single posts to be full wide and the sidebars to disappear to create more space. Reading and searching around I thought that the simple solution would be to remove the "get sidebar"- call from single.php.
    But there is no mention to the sidebar in that file! (I am using Magazine Basic, and my site is http://www.swed.info).
    Where does the sidebar call come from and how can I remove it just for single posts?
    Best regards
    Erico

  2. S.K
    Member
    Posted 4 years ago #

    The call to sidebar is in footer.php of the theme.

    But it is not straightforward removal of "get sidebar" stuff.

    The call contains some if clauses. To prevent the sidebars from appearing on your single post page you will have to introduce an if is_sidebar condition to the code snippets. I tried what follows and it worked for me!

    <?php
    if (!is_single()) {
    if(get_option('uwc_sidebar_location') == "oneright") {
    get_sidebar(1);
    }
    if(get_option('uwc_site_sidebars') == "2" && get_option('uwc_sidebar_location') == "twoseparate") {
    include(TEMPLATEPATH.'/sidebar2.php');
    }
    if(get_option('uwc_site_sidebars') == "2" && get_option('uwc_sidebar_location') == "tworight") {
    get_sidebar(1);
    include(TEMPLATEPATH.'/sidebar2.php');
    }
    }
    ?>

    HTH

    S.K

  3. ollerwe
    Member
    Posted 4 years ago #

    Thank you for your quick help.
    I understand what you mean because removing the call in the footer leaves me without sidebar all over the site.
    I will try your script.
    Thanks!
    Erico

  4. ollerwe
    Member
    Posted 4 years ago #

    It worked nicely.
    Now I will search de forum to see how I can get the post to make use of the empty room left by the sidebars.But that is another issue.
    Thank you for your help!
    Erico

Topic Closed

This topic has been closed to new replies.

About this Topic