WordPress issue with blank admin pages

So I’ve been banging my head against the metaphorical wall for hours, trying to find a solution to a buggy WordPress admin panel. I am moving a site from a development server running WP2.3 to the production server on WP2.5.1.

The symptoms:

  • Trouble getting to any page in the admin at times, unable to login, display the edit pages, etc.
  • Once logged in, when you do some kind of edit and hit save, the resulting page is blank. Nothing in view source, no error, nada.
  • Nothing useful in the log files. The blank-loading pages that were returning status code 200 (“successful”).
  • PHP was running fine. I tested this by adding an echo statement to the admin’s index.php (in the phase where *nothing* was loading, ever).

Possible Solutions:

I searched high and low for a way to solve this, and (have I mentioned lately Google is my best friend?) there are many posts about the issue. I tried a bunch of things that worked for other people:

  • Disabling all plugins by renaming the plugin folder to something else. This appears to be the solution for many, but not for me. In desperation I even created a blank plugins folder as well, as one post suggested. Not sure if that step is needed. (Note, when you revert the folder name back, you’ll have to re-activate your plugins as all will have been de-activated.)
  • Various changes to the .htaccess file such as increasing the memory limit
  • Updated the wp-config to increase memory limit with this at the top: @ini_set('memory_limit','64M'); (not even sure if these would work, if the host could override them or not. I have been dreaming of a vulcan mind meld with a sys-admin these past few days…)
  • Re-uploaded the WP files, to ensure none are corrupt.

What worked for me

None of the above worked. Finally, in desperation, I tried renaming the theme to disable it. Aha. We may have something here… Why on earth a theme that controls the public front end breaks the admin pages I have no idea. (Anyone?) But so far, it seems to be the case for me.

Trouble is of course, this is the theme we need to use, so how to find the culprit? I re-enabled the theme, and one by one moved files from their location in the theme folder to a sub-folder. (If you’re playing along at home, don’t start with index.php. That just breaks the theme because it’s required.)

Finally I think I narrowed it down to functions.php. Mine had two things in it. First, the typical register_sidebar() bit, which I didn’t need anyway since we won’t be using widgets. The second function was something I added to the file:

function the_slug() {
$post_data = get_post($post->ID, ARRAY_A);
$slug = $post_data['post_name'];
return $slug;
}

Turns out I only ended up using it in a few places, so rather than try to figure out the issue in functions.php I just replaced those places with

echo $post->post_name;

I removed the functions.php file altogether since it’s not required. And so far, so good. The admin panel appears to be stable.

If you have any experience with this issue, what was it for you?

This entry was posted in WordPress Tips and tagged . Bookmark the permalink.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv Enabled