Problem with class.php when upgrading to WordPress 2.3.1
We just upgraded a client’s site from WordPress 2.2. to WordPress 2.3.1. After upgrading, the theme still worked, but the links to Pages in the upper navigation bar stopped working and they all linked to the home page instead of to their pages, and an annoying error appeared at the top of every page as follows:
Warning: Invalid argument supplied for foreach() in /home/wallis3/public_html/wordpress/wp-includes/classes.php on line 92
In case anybody else ever encounters this problem, I found the solution after a bit of digging here in this WordPress support forum topic. It seems that some servers don’t deal well with blogs on WordPress 2.3.1 with permalinks that use /%category%/ as part of the permalink string. The server this particular site was sitting on happened to be Lunarpages.
Anyway, we removed /%category%/ from their permalink structure and updated everything in the site. Luckily the site wasn’t that old and didn’t have that much content, but it was still annoying. Update: All we had to do in the end was select the default permalink structure, click “Update Permalinks”, and then select the permalink structure that we wanted, including /%category%/, and update again, and that worked. It seems that this is a WordPress bug, and the moderators on the above support forum topic recommended submitting a bug report to WordPress, but there are so many rules to follow to submit a bug report that in the meantime I’m going to pass.
Category: Tips








Thanks for posting that. My site ran fine for a couple years and then I got that error. I didnt know wtf. I don’t recall ever setting it to custom links but that’s what it was on. I set it to default and everythings fine now. Perhaps it got hacked, I’ve had some odd chinese and russian traffic recently.
Actually it turns out it only fixed the error code and the page links along the top but my shopping cart categories were still messed up and that had to be repaired in the ecommerce section where it has links specifically to fix/update your page urls and permalinks for the cart. I think I have it all repaired now. Still not sure why it broke on me.