WordPress.org

Support

Support » Themes and Templates » Remove left sidebar for Posts

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

    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?

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

    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!

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

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

    Thanks!

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