• Hi,

    i am using Twenty eleven theme, and I managed to have my home page great and running just as I want. But I noticed that it did not show on single posts and pages. i added the code for calling the sidebar, and now appears but at the bottom of the page. Want to change width of the single posts and pages, byt can’s find the lines on the style.css. Can anyone give me hand??

Viewing 9 replies - 1 through 9 (of 9 total)
  • i added the code for calling the sidebar, and now appears but at the bottom of the page.

    for a possible solution, see my article http://www.transformationpowertools.com/wordpress/twenty-eleven-sidebar-on-single-posts-and-pages

    Thread Starter perezsan

    (@perezsan)

    I got lost on adding the new theme, where do I find the file to put on the new folder, or do I just create a new css file with the code??

    Thread Starter perezsan

    (@perezsan)

    as you can see my side bar appears: http://rainmaker18.com.previewdns.com/blog/?p=9 but want to align it to look like the main page.

    strongly consider to create a child theme to make the customisations; http://codex.wordpress.org/Child_Themes )

    however, if you are working with Twenty Eleven directly, then edit functions.php, near the end:

    function twentyeleven_body_classes( $classes ) {
    
    	if ( function_exists( 'is_multi_author' ) && ! is_multi_author() )
    		$classes[] = 'single-author';
    
    	if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) )
    		$classes[] = 'singular';
    
    	return $classes;
    }
    add_filter( 'body_class', 'twentyeleven_body_classes' );

    change that to:

    function twentyeleven_body_classes( $classes ) {
    
    	if ( function_exists( 'is_multi_author' ) && ! is_multi_author() )
    		$classes[] = 'single-author';
    
    	if ( is_singular() && !is_single() && ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) )
    		$classes[] = 'singular';
    
    	return $classes;
    }
    add_filter( 'body_class', 'twentyeleven_body_classes' );

    that should remove the .singular class from single posts, and allow the proper alignment of the sidebar.

    Thread Starter perezsan

    (@perezsan)

    Now where do I put the sidebar?? is still down?? I made the changes:

    sidebar goes here:

    </div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    Thread Starter perezsan

    (@perezsan)

    Uff, Big thanks my friend, nearly ready to launch thx to you. I suppose the same applies for pages.php?

    to have static pages show a sidebar, you could use the ‘Sidebar Template’ under ‘page attributes’ when you edit or create a psge;

    or add the sidebar code to page.php at the same location;
    and edit this one line in functions.php:

    if ( is_singular() && !is_single() && !is_page() && ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) )
    Thread Starter perezsan

    (@perezsan)

    I found the line to edit, but what do I put instead of the code?

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Sidebar for Single ppst and pages’ is closed to new replies.