[resolved] Pull query_posts from different install directory (5 posts)

  1. buymylife
    Posted 9 years ago #


    I have two separate wordpress blogs installed in two separate directories in the same domain.

    I'm trying to get my sidebar in each blog to display the recent posts from both in two different blocks -- have the recent posts from one blog displayed in a block, then the recent posts from the other blog displayed in the next block.

    I've been trying everything I can think of to make it call the php from the different directory, but truth be told, I have no idea what I'm doing!

    Any help would be much appreciated! My code from one of the blocks is below:

    <div class="block">
    <h2>Recent Blog Posts</h2>
    <ul class="dates">
    <?php query_posts('showposts=10');	?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink() ?>"><span class="date"><?php the_time('m.j') ?></span> <?php the_title() ?> </a></li>
    <?php endwhile; endif; ?>
  2. moshu
    Posted 9 years ago #

    For the "other" blog you should use the RSS feeds.

  3. buymylife
    Posted 9 years ago #

    Thanks very much moshu...

    What would be the best way to get started on that? Sorry... kinda new to all this.

  4. moshu
    Posted 9 years ago #

    Read this topic and see the links from there:

  5. buymylife
    Posted 9 years ago #

    Many, many thanks Moshu... after a lot of messing around I got it to work.

    Much appreciated!

Topic Closed

This topic has been closed to new replies.

About this Topic