Support » Themes and Templates » Remove left sidebar for Posts

Viewing 7 replies - 1 through 7 (of 7 total)
  • in the widget remove widget in sidebar-secondary area u get empty right side bar

    WRevolves

    (@wrevolves)

    That removes it from homepage too… as you can see I only want it removed on posts. And that doesn’t make the content fill up the empty space. So, hey, anybody else?

    bythegram

    (@bythegram)

    You’d want to make a Child Theme so that you can make changes to the sidebar.php file.

    This might help with that

    After you make a Child Theme you should be able to copy the “sidebar.php” file from the parent and change it to this

    <?php global $theme; ?>
    <?php if ( !is_single() ) : ?>
    <div id="sidebar-primary">
    
        <?php
            if(!dynamic_sidebar('sidebar_primary')) {
                /**
                * The primary sidebar widget area. Manage the widgets from: wp-admin -> Appearance -> Widgets
                */
                $theme->hook('sidebar_primary');
            }
            $theme->hook("sidebar_primary_after");
        ?>
    
    </div><!-- #sidebar-primary -->
    <?php endif; ?>
    
    <div id="sidebar-secondary">
    
        <?php
            if(!dynamic_sidebar('sidebar_secondary')) {
                /**
                * The secondary sidebar widget area. Manage the widgets from: wp-admin -> Appearance -> Widgets
                */
                $theme->hook('sidebar_secondary');
            }
        ?>
    
    </div><!-- #sidebar-secondary -->

    WRevolves

    (@wrevolves)

    That worked to remove the left sidebar. Thanks! How can I get the content for posts to start where sidebar was now? Too much empty space. THANKS!

    WRevolves

    (@wrevolves)

    Changing it on Style.css does it on homepage and pages too. Don’t want that.

    Michael

    (@alchymyth)

    Forum Moderator

    use the page specific css class which is output by body_class() http://codex.wordpress.org/Function_Reference/body_class ;

    example:

    .single #content { width: 630px; margin-left: 0; }

    WRevolves

    (@wrevolves)

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Remove left sidebar for Posts’ is closed to new replies.