Remove Right Sidebar from Page (9 posts)

  1. Mark
    Posted 3 years ago #

    Hello. I would like to remove the right sidebar from my page here:

    M ark


  2. Digest WP
    Posted 3 years ago #

    Just comment out the sidebar include from the template

    It looks like this

    <?php get_sidebar(); ?>
  3. Mark
    Posted 3 years ago #

    This is great - thanks!

    But how do I widen the content area on my Page now to use the right rail space that I've gained?

  4. Digest WP
    Posted 3 years ago #

    This is the CSS controlling that.

    #content {
    width: 62.5%;
    margin: 0px 0px 60px 0px;
    padding: 0px 0px 0px 60px;
    float: left;
    font-size: 14px;

    You will have to adjust the width %

  5. Mark
    Posted 3 years ago #

    Won't this change the width on posts as well?

  6. Digest WP
    Posted 3 years ago #

    Hey, sorry I was assuming the sidebar would be gone on all pages and posts.

    Add a width to this style then like in this example. That only controls pages and not posts and I think will still work with being responsive since the content is using a %

    #page {
    margin-bottom: 50px;
    width: 650px;
    padding: 0px 0px 6px 0px;
    border-bottom: 1px dotted #4C4C4C;
  7. Michael
    Forum Moderator
    Posted 3 years ago #

    the theme uses body_class() which outputs page specific css classes;
    you can use those to selectively change the formatting on the one page only;

    example (for your portfolio page):

    .page-id-1446 #main {
    width: 100%;
  8. Mark
    Posted 3 years ago #

    @alchymyth - Gave this a shot, but the results aren't so great:

  9. Michael
    Forum Moderator
    Posted 3 years ago #

    my comment only referred to applying the right formatting for a specific page;

    you still need to remove the sidebar for that page, possibly by creating a page template http://codex.wordpress.org/Pages#Page_Templates (just a copy of page.php with the necessary extra coding at the top, where you remove the <?php get_sidebar(); ?> line.

    plus more formatting with possible changes to other styles to stretch the content (which will then scroll through the site title and tag line ...)

    'the devil is in the detail'

    a bunch of extra useful css:

    .page-id-1446 #sidebar-primary .sidebar { display: none; }
    .page-id-1446 #sidebar-primary { background: #fff; padding-top:20px;margin-top:-20px; }
    .page-id-1446 #main { width:100%; }
    .page-id-1446 #content { width:95%; }
    .page-id-1446 #page { width:94%; }

    the first line of those does virtually the same job as creating a page template - it hides the sidebar.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic