wp-admin page is blank

Something is wrong with my wp-admin page, it just shows up blank. I am pretty sure it has to do with my function.php file there is no whitespace on the top or bottom, but when I delete it completely, the wp-admin folder works again.

here is the functions.php file

Read More
<?php

add_action("manage_posts_custom_column",  "booktime_custom_columns");
add_filter("manage_edit-booktime_columns", "booktime_edit_columns");

function booktime_custom_columns($column){
    global $post;

    switch ($column) {
        case "name":
            the_excerpt();
        break;
        case "address":
            $custom = get_post_custom();
            echo $custom["address"][0];
        break;
        case "phone":
            $custom = get_post_custom();
            echo $custom["phone"][0];
        break;
        case "date":
            $custom = get_post_custom();
            echo $custom["date"][0];
        break;
        case "bottles":
            $custom = get_post_custom();
            echo $custom["bottles"][0];
        break;

    }
}

function booktime_edit_columns($columns){
    $columns = array(
        "cb" => "<input type="checkbox" />",
        "title" => "Post should show",
        "description" => "name",
        "address" => "address",
        "phone" => "phone",
        "date" => "date",
        "bottles" => "bottles"
    );

    return $columns;
}

?>

<?php
add_action("admin_init", "admin_init_booktime");

function admin_init_booktime(){

    add_meta_box("name", "name", "name", "booktime", "normal", "low");

}
?>

<?php
function name() {
    global $post;
    $custom = get_post_custom($post->ID);
    $name = ( !empty($custom["name"][0]) ) ? $custom["name"][0]: "";
    ?>
    <p><label>Name:</label><br />
        <input type="text" name="name" value="<?php echo $name; ?>"/></p>
    <?php
}
?>

<?php
add_action('save_post', 'save_details_booktime');

function save_details_booktime(){
    global $post;
    $custom_meta_fields = array( 'name' );

    foreach( $custom_meta_fields as $custom_meta_field ):
        if(isset($_POST[$custom_meta_field]) && $_POST[$custom_meta_field] != ""):
            update_post_meta($post->ID, $custom_meta_field, $_POST[$custom_meta_field]);
        endif;
    endforeach;

}
?>

EDIT:
I turned wp-config debug on and I get the following

Parse error: syntax error, unexpected '<' in /Users/anderskitson/Sites/fiftyfity/wp-content/themes/fiftyfityNew/functions.php on line 61

Related posts

Leave a Reply

5 comments

  1. Have you tried changing your function names? The main one that would concern me as potentially having overlap is name(). If I’m doing a theme for myself, usually I’ll use my_ as the prefix for everything, otherwise I’ll use a unique identifier based on the name of the theme.

  2. You need to remove spaces between all closing/opening PHP tags, including:

    }
    ?>
    
    <?php
    add_action('save_post', 'save_details_booktime');
    

    and

    }
    ?>
    
    <?php
    function name() {
    

    and

    }
    
    ?>
    
    <?php
    add_action("admin_init", "admin_init_booktime");
    

    (Check your file; might not be all-inclusive.)

    Edit

    In addition to @m0r7if3r’s great answer, I would suggest the following as a means of trouble-shooting:

    1. Remove everything from functions.php
    2. Add a single, opening <?php tag. Do not add a closing tag
    3. Add in each of your functions, one at a time, until you find one that causes the site to WSOD.
    4. Fix the issue with that function
    5. Continue with each remaining function, one at a time, until you have restored all of your functions.
  3. I turned wp-config debug on, and found the bug.
    This piece of code was in there at line 61 for some reason and it was causing the error. <p><label>Name:</label><br /> <input type="text" name="name" value="<?php echo $name; ?>"/></p>

  4. To all the folks who get this kind of error a must check option.
    turn on error reporting if you have commented the lines in your wp-config.php

    @ini_set('display_errors','Off');
    

    and than check for error.
    if it has the error like this

    PHP Warning: Cannot modify header information - headers already sent by (output started at /[server info]/wp-config.php:77)
    

    than check your wp-config.php for extra space at top and bottom of the page.remove extra line spaces even. and than re-upload the wp-config.php.
    Most of time this will solve your problem.

    Happy Coding!!!!