-1

I am having an issue after migrating a project to other server. When I go to /wp-admin I am getting a 'White Screen of Death'. If I access to /wp-login.php instead I get the login form but with an advice

ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.

Obviusly my browsers are okey, and I tried from other computers

I wasted hours looking for bug and finally I commented these lines...

<?php 
function portfolio_custombox($post) {
    $stored_id = get_post_meta( $post->ID, 'pageid_destino', true);
    ?>
    <div class="settBlock"><label for="page_color_scheme">  
    <input type="number" class="" value="<?php echo $stored_id ?>" for="pageid_destino" name="pageid_destino"><br>
    <label for="pageid_destino"><?php _e('Id de la página destino (este número es el que se presenta después del argumento ?post=<b>number</b>)', MY_THEME); ?></label>
<?php } ?>

<?php 
function portfolio_addmetaboxes() {
        $postypes = array('hgr_portfolio');
        foreach ( $postypes as $posttype ) {
            add_meta_box(
            'pageid_destino',
                __( 'ID de Página Destino', MY_THEME ),
                'portfolio_custombox',
                $posttype,
                'normal',
                'high'
            );
        }
    }
    add_action( 'add_meta_boxes', 'portfolio_addmetaboxes' );
    function portfolio_savemetabox($post_id)
    {
        if ( ! isset( $_POST['pageid_destino'] ) ) {
            return $post_id;
        }
        $pageid_destino = sanitize_text_field( $_POST['pageid_destino']);
        update_post_meta($post_id, 'pageid_destino', $pageid_destino );
    }
    add_action( 'save_post', 'portfolio_savemetabox' );

After commenting these lines my loggin is working back... but... why?

And why this is not happening in my local enviroment and previous host

Thanks in advance

UPDATE

After set WP_DEBUG to true I get this error...

Warning: Cannot modify header information - headers already sent by (output started at /home/my/staging/1/wp-content/themes/attractor-child/functions_includes/functions.metaboxes.php:12) in /home/my/staging/1/wp-content/themes/attractor/highgrade/framework/core/newsflash.php on line 72

UPDATE 2

After I comment this line /home/my/staging/1/wp-content/themes/attractor/highgrade/framework/core/newsflash.php I get white screen without errors still with WP_DEBUG setted true...

closed as off-topic by Pieter Goosen, Mark Kaplun, TheDeadMedic, Sumit, Mayeenul Islam Jun 19 '16 at 3:55

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?" – Pieter Goosen, Mark Kaplun, TheDeadMedic, Sumit, Mayeenul Islam
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Have you enabled WP_DEBUG? – czerspalace Jun 15 '16 at 8:12
  • 1
    Enable debug mode - the white screen of death will then change to a white screen with an error telling you what's wrong :) – Tim Malone Jun 15 '16 at 8:12
  • Warning: Cannot modify header information - headers already sent by (output started at /home/my/staging/1/wp-content/themes/attractor-child/functions_includes/functions.metaboxes.php:12) in /home/my/staging/1/wp-content/themes/attractor/highgrade/framework/core/newsflash.php on line 72 – Apeiron Jun 15 '16 at 8:21
0

Finally I found the solution in codex....

Interpreting the Error Message:

If the error message states: Warning: Cannot modify header information - headers already sent by (output started at /path/blog/wp-config.php:34) in /path/blog/wp-login.php on line 42, then the problem is at line #34 of wp-config.php, not line #42 of wp-login.php. In this scenario, line #42 of wp-login.php is the victim. It is being affected by the excess whitespace at line #34 of wp-config.php.

If the error message states: Warning: Cannot modify header information - headers already sent by (output started at /path/wp-admin/admin-header.php:8) in /path/wp-admin/post.php on line 569, then the problem is at line #8 of admin-header.php, not line #569 of post.php. In this scenario, line #569 of post.php is the victim. It is being affected by the excess whitespace at line #8 of admin-header.php.

Other issues that might cause that error:

In case you've used the function: wp_redirect() or tried to use a header redirect after the header (or any content at all was sent) that error message will pop. Instead use javascript redirection if needed.

I removed some extra spaces and everything is working back

add_meta_box(
            'pageid_destino',
                __( 'ID de Página Destino', MY_THEME ),
                'portfolio_custombox',
                $posttype,
                'normal',
                'high'
            ); //spaces were here
  • 1
    Please accept your own answer or this question will keep popping up as unsolved in the future. – cjbj Jun 15 '16 at 10:33
  • I cant in 2 days... sry – Apeiron Jun 15 '16 at 11:01
  • sorry, forgot about that – cjbj Jun 15 '16 at 11:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.