Support » Themes and Templates » remove sidebar (on certain pages or all is ok too)

  • Hi I am using the vector lover wordpress theme and am trying to figure out how to remove the sidebar on certain, or all pages is ok too. thank you

Viewing 8 replies - 1 through 8 (of 8 total)
  • Your site url?

    i know how to remove all the content in the sidebar just that pesky line wouldn’t go away i already tried going thru and deleting all the sidebar php things, didn’t work

    Change:

    #sidebar {
    float: right;
    width: 285px;
    padding: 0;
    margin: 0 45px 0 0;
    display: inline;
    }

    to:

    #sidebar {
    float: right;
    width: 285px;
    padding: 0;
    margin: 0 45px 0 0;
    display: none;
    }

    You can create a child theme or just update the CSS your choice.

    that removed all the content in the sidebar but the separator line is still there

    It is caused by the background image on the wrapper.
    Change:

    #wrap {
    position: relative;
    width: 952px;
    background: white url(images/wrap.gif) repeat-y center top;
    margin: 40px auto 30px auto;
    text-align: left;
    }

    to:

    #wrap {
    position: relative;
    width: 952px;
    background-color: white;
    margin: 40px auto 30px auto;
    text-align: left;
    }

    aha nice..thank you.. now do you know if there’s a way to extend everything else so that’s all like 1 page? If you understand?

    Michael

    (@alchymyth)

    Forum Moderator

    how to remove the sidebar on certain pages

    a cleaner way would be to create a page template http://codex.wordpress.org/Pages#Page_Templates

    – start with a copy of page.php, save it as (for example) no-sidebar-page.php
    – add the few lines at the top to mark it as a template http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates
    – add a new css class .no-sidebar to the div #main
    – remove the <?php get_sidebar(); ?> code

    example:
    http://pastebin.com/yQetFrrT

    then, to stretch the content, add some new styles to style.css;
    example:
    #main.no-sidebar { width: 870px; }

    and in header.php, before this line:
    <?php wp_head(); ?>

    add:
    <?php if( is_page_template('no-sidebar-page.php') ) echo '<style type="text/css">#wrap { background-image: none; }</style>'; ?>

    if there’s a way to extend everything else

    alternatively, to complete what you have already started, add this to style.css:
    #main { width: 870px; }

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘remove sidebar (on certain pages or all is ok too)’ is closed to new replies.