WordPress.org

Ready to get started?Download WordPress

Forums

Remove left sidebar for Posts (8 posts)

  1. WRevolves
    Member
    Posted 1 year ago #

    I want the Posts on my website to only have the right sidebar shown and post content to fill the rest of the space. How do I do this?

    Thanks!

    http://www.wrestlingrevolves.com

  2. mukesh panchal
    Member
    Posted 1 year ago #

    in the widget remove widget in sidebar-secondary area u get empty right side bar

  3. WRevolves
    Member
    Posted 1 year ago #

    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?

  4. bythegram
    Member
    Posted 1 year ago #

    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 -->
  5. WRevolves
    Member
    Posted 1 year ago #

    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!

  6. WRevolves
    Member
    Posted 1 year ago #

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

  7. alchymyth
    Forum Moderator
    Posted 1 year ago #

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

  8. WRevolves
    Member
    Posted 1 year ago #

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.