IT Consultant – Java, J2EE, IBM WebSphere Portal, Lotus Notes/Domino
RSS icon Home icon
  • [Solved] Blank Pages with WordPress 2.6.x

    1 Star2 Stars3 Stars4 Stars5 Stars
    Loading...
    Posted on 13 September 2008 Sebastian Thomschke*/?> 2 comments

    After upgrading to WordPress 2.6 it occasionally happend that an empty page was displayed in the browser when navigating through the blog or working in the admin area. Refreshing the browser using CTRL+F5 usually helped in that case. Today I upgraded to WordPress 2.6.2 and I was not able to access the plug-ins page of the admin area anymore. No matter how often I refreshed the page in the browser it stayed blank.
    First I searched the web for possible solutions. I found quite a number of discussions giving tips about this widely known problem but unfortunately none of these solutions helped in my case.
    So I again started debugging the WordPress code and finally found the lines of code causing the trouble. The problem are (object) casts in the wp-includes/taxonomy.php file that transform an array into an object:

    $wp_taxonomies['category'] = (object) array('name' => 'category', 'object_type' => 'post', 'hierarchical' => true, 'update_count_callback' => '_update_post_term_count');
    $wp_taxonomies['post_tag'] = (object) array('name' => 'post_tag', 'object_type' => 'post', 'hierarchical' => false, 'update_count_callback' => '_update_post_term_count');
    $wp_taxonomies['link_category'] = (object) array('name' => 'link_category', 'object_type' => 'link', 'hierarchical' => false);
    

    Since I don’t get any error messages neither on the screen nor in the log files I have no idea why these casts fail. The PHP version used to serve the site is the latest stable 5.x release from php.net.
    As a workaround I introduced a function that does also transforms an array into an object but does not rely on the casting mechanism.

    function arr2obj($arr) {
    	foreach ($arr as $k => $v) $obj -> {$k} = $v;
    	return $obj;
    }
    
    $wp_taxonomies['category'] = arr2obj(array('name' => 'category', 'object_type' => 'post', 'hierarchical' => true, 'update_count_callback' => '_update_post_term_count'));
    $wp_taxonomies['post_tag'] = arr2obj(array('name' => 'post_tag', 'object_type' => 'post', 'hierarchical' => false, 'update_count_callback' => '_update_post_term_count'));
    $wp_taxonomies['link_category'] = arr2obj(array('name' => 'link_category', 'object_type' => 'link', 'hierarchical' => false));
    
     

    2 responses to “[Solved] Blank Pages with WordPress 2.6.x” RSS icon

    • Na Mensch, da hat es endlich geklappt 🙂 PHP hacken ist doch was! Habe eben auf 6.5 geupdated und alles ohne Probleme…gruß Marek

    • Hi Anthony here from wordpressmonster.org, the blank page in admin either when you add something or it just happens is normally related to the memory space being full you can increase memory space with a simple htaccess file added to the root directory of your wordpress blog. I have added a download of a htaccess file to wordpressmonster.org for anyone to use this should cure your wordpress blank page problem just unzip the file then upload the htaccess file to the root of your blog anyone who is not confident in doing the please contact me for help.

      Best Regards
      Anthony (Admin)
      Wordpressmonster.org

    Leave a reply