Header Error in Dashboard regarding Options.php File
-
I tried searching but didn’t see anything. I’m creating a site for my church using Graphene. I’m using my main site as a starting place for the design (www.jrothraministries.com). However, when I put the child theme in, I get the following on the Dashboard only (not visible on the main site):
Quote:// Theme setupWarning: Cannot modify header information – headers already sent by (output started at /home/jrothra/public_html/fbcfloralcity/wp-content/themes/graphene-child/functions.php:27) in /home/jrothra/public_html/fbcfloralcity/wp-includes/option.php on line 563
Warning: Cannot modify header information – headers already sent by (output started at /home/jrothra/public_html/fbcfloralcity/wp-content/themes/graphene-child/functions.php:27) in /home/jrothra/public_html/fbcfloralcity/wp-includes/option.php on line 564
Where I’m doing the pre-live design work is: http://www.jrothraministries.com/fbcfloralcity/
Mod
Moved to Support. Please post in the correct section next time.
You have a space either before the opening
<?phptag or after the closing?>tag (or both) in your functions file.FYI: A google search for “Cannot modify header information – headers already sent by ” returns about 15,800,000 hits. There are other reasons for this error, but this is the most common one with a WordPress child theme. PHP is sensitive about extra spaces before and after those tags.
Kenneth,
The forum location error was an oversight on my part.
On the Google search — I skipped that and searched only the forums here (Google results can be so confusing and sometimes not very helpful).
I didn’t notice any spaces in the functions that weren’t in the one I used for my personal site. The content of the two are exactly identical – absolutely no difference in what the functions.php file contains, but the error occurs only with the fbcfloralcity version.
Did you copy the parent theme’s whole functions to the child theme functions.php? If so, you shouldn’t be doing that.
Prasanna,
I didn’t copy the parent’s whole functions.php. What I copied is the child’s functions used in my personal site to start with, and planned to tweak it as needed. This can be confusing, so I’ll try to clarify.
Personal site: jrothraministries.com
Newly built site: jrothraministries.com/fbcfloralcity
The new site is on it’s own WordPress installation and database – it’s merely in a subdirectory of my personal site so I can design it before placing it on the new server at fbcfloralcity.org.
To keep things as simple for me as can make them, I copied the content of my personal site’s child theme’s CSS and functions.php. Here’s the content of the functions.php in the new site:
<?php
function graphene_filter_gettext( $translated, $original, $domain ) {
$strings = array(
'Follow me on Twitter' => 'Follow John on Twitter',
);
if ( ! empty( $strings[$original] ) ) {
$translations = &get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}
return $translated;
}
add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );
function graphene_custom_generic_img(){
return '<img alt="" src="'.get_stylesheet_directory_uri().'/images/NewLogoJRM-150w150h.png" />';
}
add_filter( 'graphene_generic_slider_img', 'graphene_custom_generic_img' );
function graphene_custom_content_related_posts_slider(){
if( function_exists('get_related_posts_slider') && is_singular() ){
get_related_posts_slider();
}
}
add_action( 'graphene_after_post_content', 'graphene_custom_content_related_posts_slider' );
?>I can count only 26 lines in your child-theme’s functions.php. And, the error message says that output started at 27th line. So, as Ken told, there might be a blank space/line at the end of closing php tag. Using a code editor like gedit, notepad++ or cPanel code editor place cursor at the end of the 26th line and press hold delete button for a few seconds and save the file.
Viewing 7 posts - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.
