The MU forums have moved to WordPress.org

error with functions.php??? (7 posts)

  1. sepp88
    Member
    Posted 14 years ago #

    hi there, i'm finally getting there where i want with my wpmu blog. so far everything is really awesome. i tried to implement this custom header code... http://wpmututorials.com/how-to/giving-your-users-changeable-custom-headers/

    however i have little problem.

    everytime i add the edited functions.php with the following lines...

    <?php
    	if ( function_exists('register_sidebars') )
    	register_sidebars(1);
    ?>
    
    <?php
    
    //make changeable header
    
    define('HEADER_TEXTCOLOR', '');
    define('HEADER_IMAGE', 'images/headers/header.png'); // %s is theme dir uri
    define('HEADER_IMAGE_WIDTH', 900);
    define('HEADER_IMAGE_HEIGHT', 188);
    define( 'NO_HEADER_TEXT', true );
    
    function modicus_remix_admin_header_style() {
    ?>
    <style type="text/css">
    #headimg {
    	height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
    	width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
    }
    
    #headimg h1, #headimg #desc {
    	display: none;
    }
    
    </style>
    <?php
    }
    
    function header_style() {
    ?>
    <style type="text/css">
    #headerimg{
    	background: url(<?php header_image() ?>) no-repeat;
    }
    </style>
    <?php
    }
    
    add_custom_image_header('header_style', 'modicus_remix_admin_header_style');
    
    ?>

    ... and i get back to my admin and try for instance to log out i get a white page. it's actually loggin me out, however i get a white page. the same happens if i try to SAVE OR EDIT a post. i can ALMOST NORMALLY use the admin panel, can click everywhere, however if i save, edit or apply anything or log out, i get a blank white page.

    why? can you see any mistakes in the code?

  2. andrea_r
    Moderator
    Posted 14 years ago #

    Did you check your error logs?

  3. sepp88
    Member
    Posted 14 years ago #

    how can i do that?

  4. SteveAtty
    Member
    Posted 14 years ago #

    your php.ini should have an error level set and an error log location. It if hasn't (and its not got display errors enabled) then you really need to set it.

  5. sepp88
    Member
    Posted 14 years ago #

    oh, i found it...and then??

    i get this error:

    [11-Aug-2009 22:25:29] PHP Warning: Cannot modify header information - headers already sent by (output started at /Users/myusername/htdocs/wordpress.mu/wp-content/themes/modicus-remix/modicus-remix/functions.php:8) in /Users/myusername/htdocs/wordpress.mu/wp-includes/pluggable.php on line 865

    and now?

  6. andrea_r
    Moderator
    Posted 14 years ago #

    Check for blank lines at the end of the file AND and the begging.

    Also, near the top you have

    <?php
    if ( function_exists('register_sidebars') )
    register_sidebars(1);
    ?>

    <?php

    //make changeable header

    Make it liek this:

    <?php
    if ( function_exists('register_sidebars') )
    register_sidebars(1);

    //make changeable header

    No need to close php & open it again on the very next line.

  7. sepp88
    Member
    Posted 14 years ago #

    thanks, thats it. it works.

About this Topic