• Hi
    I would like to add the sidebar to all the single post pages in a twenty-eleven theme site. Is it possible? Any help appreciated.
    Many thanks, Greg

Viewing 2 replies - 1 through 2 (of 2 total)
  • create a child theme https://codex.www.ads-software.com/Child_Themes first and make the edits in there;

    edit single.php in the child theme (copy it from the Twenty Eleven parent theme and save it in the child theme, using ftp or cpanel)
    and add <?php get_sidebar(); ?> before the line with ‘get_footer’;

    create a new functions.php (using ftp or cpanel) in the child theme, and add <?php in the first line.

    add:

    add_filter('body_class', 'adjust_te_body_class', 20, 1);
    function adjust_te__body_class($wp_classes) {
    if( is_single() ) :
          foreach($wp_classes as $key => $value) {
          if ($value == 'singular') unset($wp_classes[$key]);
          }
    endif;
    return $wp_classes;
    }

    possibly for fine tuning, add a few styles to style.css of your child theme;
    examples see in my article

    Thread Starter cgsmith1

    (@cgsmith1)

    Brilliant…thank you so much. Greg

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add Sidebar to a Single Post page’ is closed to new replies.