• Resolved DancingFighterG

    (@dancingfighterg)


    I’m getting the following error for my website:

    Cannot modify header information – headers already sent by (output started at /home/content/10/3671710/html/shadesofhappiness/wp-content/themes/hd/functions.php:16) in /home/content/10/3671710/html/shadesofhappiness/wp-includes/pluggable.php on line 1121

    I’m currently using wordpress and a child theme called HD in correlation with the master theme Customizr. This error only comes up when I try to access the wp-admin side of the site.

    I’ve never seen this error before as I don’t know what pluggable.php does. I have the code if needed

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter DancingFighterG

    (@dancingfighterg)

    I was able to get rid of the error but to do it I removed the entire function.php. There is something going on with the function.php file but I don’t know what as it applies to the pluggable.php

    Here is what is currently in the function.php for the child function. It has been working fine so far:

    <?php
    /**
    * This is where you can copy and paste your functions !
    */

    add_filter(‘tc_colophon_right_block’, ‘my_image’);
    function my_image(){
    $img_url = get_stylesheet_directory_uri().’/imgs/hdfooterlogo.png’; //put your image in child-theme/imgs
    $width = ‘250px’; /* change these values */
    $height = ’79px’; /* ^ */
    $img = ‘<img alt=”logo” src=”‘.$img_url.'” width=”‘.$width.'” height=”‘.$height.'” class=”pull-right”>‘;
    return ‘<div class=”span4 right-image”>’.$img.'</div>’;
    }
    ?>

    <?php
    add_filter( ‘tc_credits_display’, ‘my_credits_display’ );
    function my_credits_display($html) {
    $logo_src = esc_url ( tc__f( ‘__get_option’ , ‘tc_logo_upload’) ) ;
    if ( empty($logo_src) )
    return $html;
    ?>
    <div class=”span4 credits”>
    <?php
    $credits = sprintf( ‘<p> · ? %1$s · Shades of Happiness·</p>’,
    esc_attr( date( ‘Y’ ) ),
    esc_url( home_url() ),
    esc_attr(get_bloginfo()),
    ‘<img src=”‘.$logo_src.'” alt=”‘.esc_attr(get_bloginfo()).'”>’,
    Hunter Douglas
    );
    echo $credits;
    ?>
    </div>
    <?php
    }

    @ line 14 you are exiting php mode and re-entering it on line 16. You are doing so between functions, sending two empty lines.

    Do not exit php mode outside functions! Here’s the corrected code:

    <?php
    /**
    * This is where you can copy and paste your functions !
    */
    
    add_filter('tc_colophon_right_block', 'my_image');
    function my_image(){
    	$img_url = get_stylesheet_directory_uri().'/imgs/hdfooterlogo.png'; //put your image in child-theme/imgs
    	$width = '250px'; /* change these values */
    	$height = '79px'; /* ^ */
    	$img = '<img alt="logo" src="'.$img_url.'" width="'.$width.'" height="'.$height.'" class="pull-right">';
    	return '<div class="span4 right-image">'.$img.'</div>';
    	}
    
    add_filter( 'tc_credits_display', 'my_credits_display' );
    function my_credits_display($html) {
    	$logo_src = esc_url ( tc__f( '__get_option' , 'tc_logo_upload') ) ;
    	if ( empty($logo_src) ) return $html; ?>
    
    	<div class="span4 credits"><?php
    	$credits = sprintf( '<p> · ? %1$s · Shades of Happiness·</p>', esc_attr( date( 'Y' ) ),
    		esc_url( home_url() ),
    		esc_attr(get_bloginfo()),
    		'<img src="'.$logo_src.'" alt="'.esc_attr(get_bloginfo()).'">',
    		'Hunter Douglas'
    		);
    	echo $credits; ?>
    	</div> <?php
    	}

    Please note that the WP forum parser might have changed some middots into actual middots in your code. You should try to use the original code. Just remove the faulty

    ?>
    [unwanted empty space here]
    <?php

    from line 14.

    Thread Starter DancingFighterG

    (@dancingfighterg)

    Perfect. Thanks bud. Wow, how did I miss that!! Thanks

    Thread Starter DancingFighterG

    (@dancingfighterg)

    I might still have an issue. Will let you know in a sec

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Inability to access admin area with theme’ is closed to new replies.