Okay otto42, that did partially solve the problem... I used the query_posts() and put the 2.5 version of rewrite.php back and the code now works with permalinks set custom.
But now another problem has shown up, which involves multiple installs of WP.
I have two seperate blog installs at mydomain.com/blog1 and mydomain.com/blog2. Note that mydomain.com is outside all the WP installs.
An external program that tries to pull the posts out of each blog, always gets the blog1 posts, even when it should be getting blog2 posts. Here's how to recreate:
Take the following code:
//Displays the title of the 3 most recent posts in the blog
if (have_posts()) : while (have_posts()) : the_post();
<?php endwhile; endif; ?>
Save it as BlogOnePosts.php and upload it to mydomain.com/blog1 directory. Now save the same code again as BlogTwoPosts.php and upload it to mydomain.com/blog2 directory.
Go to both mydomain.com/blog1/BlogOnePosts.php and then mydomain.com/blog2/BlogTwoPosts.php and you will see that they each correctly display the last three posts for each blog seperately.
Now take this code:
Blog 1<br />
<?php include('/home/public_html/blog1/BlogOnePosts.php'); ?>
<br /><br />
Blog 2<br />
<?php include('/home/public_html/blog2/BlogTwoPosts.php'); ?>
Save it as BlogPosts.php and upload it to your mydomain.com directory (outside both wordpress installs).
Now goto mydomain.com/BlogPosts.php
You will probably get an error message:
WARNING: require('./wp-blog-header') No Such File Or Directory
Not sure if this is expected behaviour, but here's how we fix it...
In the BlogOnePosts.php change this line:
to this line:
Now in the BlogTwoPosts.php change this line:
to this line:
Now got back to mydomain.com/BlogPosts.php, and you see that Blog 1 shows the three most recent posts correctly, but Blog 2 shows the three most recent posts from Blog 1 as well instead of it's own posts.
Fixed one problem... on to the next one!!!