Forums

Display posts from other MU site (1 post)

  1. brigitte11
    Member
    Posted 1 year ago #

    Hello,

    I installed WordPress 3.0 and created multiple sites. I have one main site and 3 subsites. All the posts are published on the main site and classified by categories.

    In the subsites, I would like to display the posts from a specific category from the main site. Therefor I created a new page-template with the following code but it gets the posts from the current site. How can I indicate to get the posts from the main site ?

    <?php query_posts('category_name=Food', '&post_status=publish,future');?>
    
    	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
        <div class="post clearfix" id="single_post">
         <div class="post_content_wrapper"><?php the_category('/blog/category/food/'); ?>&nbsp; - &nbsp;<?php the_time('d') ?>/<?php the_time('m') ?>/<?php the_time('Y') ?>
          <h5 class="post_title2"><span><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span></h5>
          <?php the_excerpt(__('Read more', 'monochrome')); ?>
    	</div></div>
    	<?php endwhile; else: endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags