2009年10月2日

WordPress MU: search or display different blogs content in Master Blog

BEFORE
<?php if (have_posts()) : while (have_posts()) : the_post(); ? >

ADD THIS
<?php switch_to_blog(2); ?>
Define the BLOG ID -> The number in ()

Define how many transaction you need
<?php $recent = new WP_Query("showposts=3"); ?>

-- full code --
<?php 
if(have_posts()) :
$recent = new WP_Query("showposts=3");
while($recent->have_posts()) : $recent->the_post();
?>

沒有留言: