WordPress update, site goes AWOL

Astute observers (thank you Shawn!) noticed that some of the pages were missing from the blog. In particular, the static pages. The dynamically generated posts were fine. Which is probably why I didn’t notice immediately.

Over XMas I upgraded WordPress to the latest/greatest release, V2.0. It has a very fancy new admin section and a bunch of other improvements… been extensively tested, in beta for weeks. What can go wrong???

Well, a bunch really… For starters, there is the problem mentioned above. If you have static pages and you have created a particular permalink structure, it will not function any longer. Some permalink structures will, so not everyone noticed the problem. The reason it stopped working is not particularly clear. In some cases it was because a plugin used an old API, in other cases, like this, because the old mod_rewrite rules have been replaced by some WordPress rewrite rules parser that didn’t quite ‘get it right’.

So, if you have a similar problem, here is what solved it for me: get a replacement for wp-includes/functions-post.php and wp-includes/classes.php. They are available from here and plugged right in without problem.

If that doesn’t solve the problem, you can try disabling plugins until the problem disappears (this sorts out plugins that are using the older API). Or you can search through the WP forums. And I hope they’ve fixed the forums by then, because there was quite a bit broken at the time I was there.

Other problems surfaced because the API call ‘the_content’ used to allow an alternative file to display the content in. This seems to have mysteriously disappeared. The old usage used to be:
<?php the_content('more_link_text', strip_teaser, 'more_file'); ?>

But now the ‘more_file’ parameter is simply ignored. There is a workaround for this though, which is to create a filter that will add the ‘more_file’ into the output of the the\_content() call.
Something like this:
Let’s assume that I originally had:
the_content( '(more...)', 0, 'articles.php');

and that this would reroute the ‘(more…)’ link to said page.

Now, I have to add, at the top of the index file, the following:

function redir_article($data) { $data = str_replace( "/?p", "/articles.php?p", $data ); return $data; } add_filter( 'post_link', 'redir_article');

This should have the desired effect (well, it’s worked here).

Further problems surfaced because, as some of the API’s have changed in undocumented ways, parts of the theme started failing in similarly mysterious ways. I think I’ve washed the bugs out now, let me know if any more surface…

One thought on “WordPress update, site goes AWOL”

Comments are closed.