ThemeShaper Forums » Thematic

[closed]

function causing WP-Admin problem

(4 posts)
  • Started 3 years ago by jameskyle
  • Latest reply from jameskyle
  • This topic is resolved
  1. I believe I have a problem with my theme which causes my WP-ADMIN screen to show nothing but white space. I've tested this on two different installs of WP hosted on different machines and I'm confident it's not a WP problem but something I've done in the process of constructing a Thematic framework child theme.

    All the work I've done on the theme is in two areas, my style.css and functions.css. I do not think my style.css file would cause any problems, and an error message displayed by Firefox leads me to believe it's my functions.php file that's the problem.

    Here's my functions.php in full:

    <?php
    
    function my_scripts() { ?>
        <script type="text/javascript">
        jQuery.noConflict();
        function equalHeight(group) {
            tallest = 0;
            group.each(function() {
                thisHeight = jQuery(this).height();
                if(thisHeight > tallest) {
                    tallest = thisHeight;
                }
            });
            group.height(tallest);
        }
    		jQuery(document).ready(function() {
    		equalHeight(jQuery("#content,#secondary"));
        });
        </script>
    
    <?php }
    add_action('wp_head','my_scripts');
    
    function add_stuff(){
    	echo '<div id="header-menu">As Fission Design we are a collective of creative people promoting our work and our creative industry.</div>';
    }
    add_action('thematic_header','add_stuff',6);
    
    // Remove default Thematic actions
    function remove_thematic_actions() {
        remove_action('thematic_header','thematic_access',9);
    }
    add_action('init','remove_thematic_actions');
    
    add_action('thematic_aboveheader','thematic_access',9);
    ?>

    This is the error that Firefox returned when I tried my theme on a second WP install. The text was displayed after I logged out of my WP site. The site automatically logged me in, and once I'd changed the theme to the problematic one I logged out to see this:

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-login.php on line 337

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-login.php on line 349

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 717

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 718

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 719

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 720

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 721

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 722

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 725

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 726

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 727

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 728

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 731

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 732

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 733

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 734

    Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/sandbox/wp-content/themes/test_theme/functions.php:41) in /home/xxxxxxxx/public_html/sandbox/wp-includes/pluggable.php on line 890

    I've changed the path as it contained my cPanel user name, but otherwise it's as displayed. I apologise if this is a very simple PHP question, but I've a very limited knowledge of the language.

    Posted 3 years ago #
  2. Definetely a functions.php problem. If I rename the file the site displays differently as I'd expect, and I can access wp-admin again.

    Removing any unnecessary functions I'm left with this:

    <?php 
    
    function add_stuff(){
    	echo '<div id="header-menu">As Fission Design we are a collective of creative people promoting our work and our creative industry.</div>';
    }
    add_action('thematic_header','add_stuff',6);
    
    // Remove default Thematic actions
    function remove_thematic_actions() {
        remove_action('thematic_header','thematic_access',9);
    }
    add_action('init','remove_thematic_actions');
    add_action('thematic_aboveheader','thematic_access',9);
    ?>

    The problem persists however.

    Posted 3 years ago #
  3. the "Warning: Cannot modify header information - headers already sent by " problem is commonly caused by having extra space after the last ?> of the file.

    Posted 3 years ago #
  4. Thanks for posting the solution. I managed to track it down eventually once I'd deleted all the functions and left it with only a <php ?>. it still didn't work, and removing the unnecessary white space didn't work either until I reached the files end. It's good to see it's a known problem with extra lines, and not some crazy DreamWeaver CS3 bug or invisible character or something.

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.