Sidebar is at the bottom of the page when viewing full-page post (3 posts)

  1. ramsydney
    Posted 3 years ago #

    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:

    Thanks so much in advance.

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

  2. Andrew Nevins
    Forum moderator
    Posted 3 years ago #

    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?

  3. Michael
    Forum Moderator
    Posted 3 years ago #

    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.

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

Topic Closed

This topic has been closed to new replies.

About this Topic