sebthom.de

Menu
  • Home
  • About me
  • Imprint
    • Datenschutzerklärung
  • Guestbook
Menu

[Solved] Blank Pages with WordPress 2.6.x

Posted on 2008-09-132012-12-18 by sebthom

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 thoughts on “[Solved] Blank Pages with WordPress 2.6.x”

  1. Marek says:
    28 November 2008 at 11:43 PM

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

  2. Anthony says:
    31 March 2011 at 11:55 AM

    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 Cancel reply

Your email address will not be published. Required fields are marked *

Language

    English English    Deutsch Deutsch    

Categories

  • IT (25)
    • Development (15)
      • Java (7)
      • Jython (3)
      • Visual Basic (5)
    • Freeware Tips (1)
    • Linux (3)
    • WebSphere Portal (2)
    • Windows (1)
    • Wordpress (4)
  • My Freeware (2)
  • My Music (3)

Recent Posts

  • [Solved] Windows 7 “Safely Remove Hardware” pop-up menu horrendously slow
  • Bash: Capturing stderr in a variable while still printing to the console.
  • Configuring EMF Teneo with Hibernate, Commons DBCP, Spring Hibernate Transaction Manager, and the OpenSessionInViewFilter
  • Using EMF ECore model objects with Wicket components
  • Installing Tomcat 6 on Debian Squeeze
  • Leveraging PyDev’s auto-completion for indirectly created objects
  • OVal 1.40 released
  • Installing WebSphere Portal in a local network
  • Comparing version numbers in Jython / Python
  • Running TomCat 6 in Debug Mode under Windows

Blogroll

  • E L S U A
  • elektrofever.de
  • OVal
  • Sweettt.com
  • Twins’ Running Blog

Recent Comments

  • Luis Diego Villarreal on Excel – VBA Timer Example v1.0.1
  • jonathan on Guestbook
  • Pierre on Lotus Notes’ [Send only] and [Send and File] buttons for Outlook 2003
  • Yereverluvinunclebert on MyPad v1.1.6 – a PHP Editor
  • Sebastian Thomschke on MyPad v1.1.6 – a PHP Editor

Archives

  • May 2012
  • January 2011
  • October 2010
  • September 2010
  • March 2010
  • February 2010
  • September 2009
  • July 2009
  • March 2009
  • February 2009
  • November 2008
  • September 2008
  • May 2008
  • April 2008
  • September 2007
  • July 2007
  • July 2004
  • March 2003
  • August 2002
  • April 2002
  • January 2002
© 2021 sebthom.de | Powered by Minimalist Blog WordPress Theme