query two different installs
-
I have two wordpress installations and in subdirectories and I would like to include the last five post titles from each on my main site.
I can make the first work but the second list loads the first blogs links. Im assuming because I cant include the wp-blog-header.php twice.
Can anyone think of a way to do this?
this is the code im using for the first:
<?php
// Query Andfound's WordPress install for last 5 posts
define('WP_USE_THEMES', false);
include_once('andfound/_cms/wp-blog-header.php');
query_posts('posts_per_page=5');
?>
<dl>
<dt>Recent Posts</dt>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<dd><a href="<?php the_permalink() ?>" title="get_the_title()"><?php get_the_title() ?></a></dd>
<?php endwhile; ?>
</dl>
<?php else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif;
?>
The topic ‘query two different installs’ is closed to new replies.