WordPress.org

Ready to get started?Download WordPress

Forums

multiple blogs - content from blog2 displayed in blog1 (2 posts)

  1. Brent Toderash
    Member
    Posted 4 years ago #

    I have two blog installs sharing a single database with different table prefixes; there is a different set of users for each blog, but same theme & domain; blog2 is installed in a subfolder.

    I need to develop a zine-style front page for blog1 that incorporates content from blog2. I don't think RSS will give me enough flexibility with the data, which I should be able to call directly. After trying a few different solutions, I thought of simply redefining $table_prefix and doing a wp_query for each:

    $firstQuery = new WP_Query('posts_per_page=5');
    while ($firstQuery_a->have_posts()) : $firstQuery->the_post();

    --display stuff--
    endwhile;

    Works fine for blog1. Then I redefine $table_prefix = prefix2_ before setting up my $secondQuery same as above. For some reason, I still get the posts from blog1 in my$secondQuery`

    Am I missing something, or is there a better way to achieve the same result?

  2. Brent Toderash
    Member
    Posted 4 years ago #

    ::nudge::

    Any ideas on this?

Topic Closed

This topic has been closed to new replies.

About this Topic