The MU forums have moved to

newbie question: adding wpmu code to existing site problem (3 posts)

  1. wclark
    Posted 13 years ago #

    Hi there,

    I have WPMU installed on my existing domain,

    I have a main blog at

    And have several subblogs at

    The sites come up at and
    I get to their blogs at and

    The sites and blogs seem to work correctly.

    I want to add a code block to my existing index page for site1 that displays the latest 3 blog posts. Now starts my problem. That gets re-directed to the main blog page:

    So I created a simple php page testblog.php to test. It also redirects to

    testblog.php contains:

    define('WP_USE_THEMES', false);
    <?php if(have_posts() ) : while (have_posts()) : the_post(); ?>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a><br />
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>

    When I go to I get redirected to

    I expect it to show me the posts for site1. They do exist. If I go to then I see the blog posts.

    Can anyone help? I hope this is a simple/stupid fix. :-)

    best regards,

  2. andrea_r
    Posted 13 years ago #

    Whatever you dump in the root will be read for all blogs. :)

    make your code part of the theme (like a page template) that is running on your main blog.

  3. wclark
    Posted 13 years ago #

    Hi andrea_r,

    Thanks for the reply. I don't understand "Whatever you dump in the root will be read for all blogs".

    I thought I could use the wordpress functions to access the posts in my main blog and the sub-blogs...

    My plan is to insert the code block into my existing index pages for and

    I thought WPMU would know by scope that the functions were accessed from and would then show the posts for site1. But instead, is being redirected to

    Sorry if I am not being clear.

About this Topic