WordPress.org

Support

Support » How-To and Troubleshooting » Sidebar is at the bottom of the page when viewing full-page post

Sidebar is at the bottom of the page when viewing full-page post

  • I have added the line <?php get_sidebar(); ?> to the bottom of single.php in an attempt to add in the right column sidebar to my full-page posts.

    On the full post page the sidebar now appears at the bottom of the page, below the content and comments box. I understand I need to change the style.css page but, after playing around with it for ages, can’t work out what I need to do.

    I’m hoping someone may have encountered the same problem and can let me know what code I need to change.

    Here is a link to the page:
    http://blog.rammarketing.com.au/?p=58

    Thanks so much in advance.

    P.S. I am using twentyeleven template which have edited.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Andrew Nevins

    @anevins

    Forum moderator

    Have you tried similar forum threads http://wordpress.org/search/sidebar+displaying+at+bottom?forums=1 ?

    Have you made a Child Theme of Twenty Eleven?

    Michael

    @alchymyth

    Forum Moderator

    I’m hoping someone may have encountered the same problem

    many have – the forum is full with topics about the same ‘problem’ – how to add a sidebar to posts in Twenty Eleven – have you tried the forum search?

    first step is always to create a child theme http://codex.wordpress.org/Child_Themes to work with – do not edit the default theme Twenty Eleven directly.

    for many users, using the plugin http://wordpress.org/extend/plugins/twenty-eleven-theme-extensions/ works fine;
    some users prefer coding as described in my tutorial.

    edit:
    simplified:
    to re-adjust the body_class() output on the single post, add this to functions.php of the child theme:

    add_filter('body_class', 'adjust_body_class', 20, 2);
    function adjust_body_class($wp_classes, $extra_classes) {
    if( is_single() ) :
          foreach($wp_classes as $key => $value) {
          if ($value == 'singular') unset($wp_classes[$key]);
          }
    endif;   // Add the extra classes back untouched
    return array_merge($wp_classes, (array) $extra_classes);
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sidebar is at the bottom of the page when viewing full-page post’ is closed to new replies.
Skip to toolbar