WordPress.org

Ready to get started?Download WordPress

Forums

remove sidebar (on certain pages or all is ok too) (9 posts)

  1. brianz19
    Member
    Posted 1 year ago #

    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

  2. potentweb
    Member
    Posted 1 year ago #

    Your site url?

  3. brianz19
    Member
    Posted 1 year ago #

  4. brianz19
    Member
    Posted 1 year ago #

    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

  5. potentweb
    Member
    Posted 1 year ago #

    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.

  6. brianz19
    Member
    Posted 1 year ago #

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

  7. potentweb
    Member
    Posted 1 year ago #

    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;
    }
  8. brianz19
    Member
    Posted 1 year ago #

    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?

  9. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    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; }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.