Support » Fixing WordPress » blank post.php, categories.php … any-update-redirect-page.php

  • i’m having the same ‘blank page’ problems that other wp users have had (every time a post/category/anything else is updated, i am redirected to a blank page). however, despite all my research, i am yet to find a solution.

    i’m currently developing my site ‘offline’ on my computer. i have no active plugins, i’ve checked the wp_options database for spam, i’ve reinstalled wp2.6.2 (bar the wp-content folder), but still no luck.

    any ideas?



Viewing 15 replies - 1 through 15 (of 17 total)
  • What kind of environment are you running on your local machine?

    im on os x 10.5.4, running mamp 1.7.1 for the php(5) and mysql stuff.
    quite strange really – considering all was well, then suddenly it goes a bit funny.

    also my post editor is playing up – it only displays an html editor (even tho the ‘visual’ tab is highlighted)?? not sure if that is related to this problem??


    edit: ARGH! what’s going on!? – it seems to be falling apart – wp-admin/ is blank now – i can’t login!

    I’m wondering if it’s a problem with your system. I haven’t run into this kind of a problem before, so I don’t know what to tell you. Do the blank pages have content when you come back, or are they completely empty? Are you logging activity on your server? Maybe you have something else running that’s overwriting the files.

    thanks for your reply.

    when i edit or write a post, it gets posted correctly; and if i press ‘back’ the content is there.

    how do i check the server log?

    thanks again


    ok – i binned off MAMP and reinstalled it, as well as wordpress.

    i can login now, but still having the problem of blank update pages?!

    post.php, page,php, link.php, categories.php, edit-tags.php…all blank when i add or edit a post, page, link etc…

    edit: i’ve narrowed it down to be a problem with my theme! i’ll let you know exactly what the problem is when i find out!

    turns out it was a faulty function in functions.php
    any idea what the problem with this is:

    function flickr_badge($category_name) {
    $badge_url = '' . $category_name;
    $badge_html = file_get_contents($badge_url);
    preg_match_all("/<a.*a>/", $badge_html, $match_a); 
    foreach($match_a[0] as $div) {
    	echo str_replace("></a>", "/></a>", $div);


    $badge_url is simply an address from flickr that images tagged with $category_name



    I’ve found a similar problem elsewhere in the forums. It looks like some hosts have problems with the file_get_contents() function (some commercial hosts don’t have something enabled, your system might be doing the same thing).

    They’re solution was to add their own function and then call it instead:

    function my_file_get_contents($url) {
        $ch = curl_init();
        $timeout = 5; // set to zero for no timeout
        curl_setopt ($ch, CURLOPT_URL, $url);
        curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
        $file_contents = curl_exec($ch);
        return $file_contents;

    Then change the $badge_url line to:
    $badge_html = my_file_get_contents($badge_url);

    You can add the above function directly into the functions.php file of your theme and it should work just fine. Let me know if it doesn’t.

    the function i posted works, but actually whenever i add a second function to functions.php, it breaks wordpress (i get all the problems detailed above)!?

    Interesting problem … can you post your theme functions file for us to look at?

    Use the WP pastebin so we don’t take up too much forum space:

    ok, well i’ve taken out all the functions i was using, bar one, but for this demonstration, i’ve included your ‘my_file_get_contents()’ function:

    if i use this functions.php it breaks wp totally.

    edit: i’ve just tried to include both functions within the same <?php ?> tags and it seems to work ok…for now…

    One thing that I see right off the bat is a breaking line in your first function, show_authors(). Your echo statements:

    echo '<li><a href="';
    echo '/people/#' . $user->first_name .  '">' . $user->first_name . ' ' . $user->last_name . '</a></li>';

    … will actually end up breaking across multiple lines. I’d recommend replacing it with a single-line echo:
    echo '<li><a href="' . get_bloginfo('url') . '/people/#' . $user->first_name . '">' . $user->first_name . ' ' . $user->last_name . '</a></li>';
    This will prevent your line from breaking and will echo back your

  • seamlessly. Using get_bloginfo() rather than bloginfo() will also let you display things in-line because it returns data rather than echo it back by itself.
  • Of course, if show_authors() is already working just fine for what you need, don’t change anything!

    I think including both functions in the same <?php ?> call will help, and you say it’s working so far … Have you tried adding functions back in one at a time to see which one(s) break?

i tried a single line statement first, and had problems – maybe because of the differences between get_bloginfo() and bloginfo(). it all works like a dream now, even when in separate <?php ?> tags – thanks a lot.

(i still think its a little wierd that it can break (near enough) the whole system – oh well)

thanks again

I’m glad it’s working now! I had a similar problem using bloginfo() in code I had in my header – the whole page seemed to break. I figured it might be a similar issue with your site which is why I recommended the one-line format with get_bloginfo().

Good luck with everything else!

it’s nice to hear that others have had similar problems!
thanks so much for your help.



I think I’m having the same problem here. Can someone tell me how I can solve this problem like he did above please?! I’m not that great with all this coding stuff but simple instructions would be nice!


Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘blank post.php, categories.php … any-update-redirect-page.php’ is closed to new replies.