简单列出最近所有关于网络的帖子,不要列出热门帖子;对于热门帖子,您必须使用插件或通过谷歌分析等跟踪。
<ul class=\'postlist no-mp\'>
<?php
$blogs = $wpdb->get_results(
"SELECT blog_id,path FROM {$wpdb->blogs}
WHERE blog_id != {$wpdb->blogid}
AND site_id = \'{$wpdb->siteid}\'
AND spam = \'0\'
AND deleted = \'0\'
AND archived = \'0\'
order by blog_id", ARRAY_A
);
if ( 0 < count( $blogs ) ) :
foreach( $blogs as $blog ) :
switch_to_blog( $blog[ \'blog_id\' ] );
if ( get_theme_mod( \'show_in_home\', \'on\' ) !== \'on\' ) {
continue;
}
$description = get_bloginfo( \'description\' );
$blog_details = get_blog_details( $blog[ \'blog_id\' ] );
?>
<li class="no-mp">
<h2 class="no-mp blog_title">
<a href="<?php echo $blog_details->path ?>">
<?php echo $blog_details->blogname; ?>
</a>
</h2>
<div class="blog_description">
<?php echo $description; ?>
</div>
<?php
query_posts( \'showposts=5\' );
if ( have_posts() ) :
while( have_posts() ) :
the_post();
?>
<div class="blog_post">
<div class="post_title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</div>
<div class="post_excerpt">
<?php the_excerpt(); ?>
</div>
</div>
<?php endwhile; ?>
<?php endif;
restore_current_blog();
?>
</li>
<?php endforeach;?>
</ul>