Cannot modify header information – headers already sent
-
To add the sidebar in my twentyeleven theme I’ve added functions.php + single.php files to my twentyeleven-child theme. But now it gives the following error:
Warning: Cannot modify header information – headers already sent by (output started at /home2/voiceact/public_html/oop/wp-content/themes/twentyeleven-child/functions.php:2) in /home2/voiceact/public_html/oop/wp-includes/pluggable.php on line 881
My functions.php in the child theme:
<?php function remove_twentyeleven_body_classes() { remove_filter( 'body_class', 'twentyeleven_body_classes' ); } add_action( 'after_setup_theme', 'remove_twentyeleven_body_classes' ); ?>My single.php in the child theme:
<?php /** * The Template for displaying all single posts. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ get_header(); ?> <div id="primary"> <div id="content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <nav id="nav-single"> <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3> <span class="nav-previous"><?php previous_post_link( '%link', __( '<span class="meta-nav">←</span> Previous', 'twentyeleven' ) ); ?></span> <span class="nav-next"><?php next_post_link( '%link', __( 'Next <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?></span> </nav><!-- #nav-single --> <?php get_template_part( 'content', 'single' ); ?> <?php comments_template( '', true ); ?> <?php endwhile; // end of the loop. ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Cannot modify header information – headers already sent’ is closed to new replies.