有一个主页,事情进展顺利。
但是主页应该显示每个指定类别的 1 个帖子...它正在显示更多...
尝试使用showposts和posts_per_page,但没有成功
这是页面的副本,两者都无济于事:
have_posts()) : $mb_recent->the_post(); $更多 = 0; ?> <!-- post -->
<div class="post archive">
<div class="post-comments"><?php comments_popup_link('0', '1', '%'); ?></div>
<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
<div class="post-date"><?php the_time('l, F jS, Y') ?></div>
<?php if (get_post_meta($post->ID, 'post_image_value', true)) { ?><div class="post-tnail"><a href="<?php the_permalink() ?>"><?php if (get_post_meta($post->ID, 'post_image_value', true) && $mb_resize == 0) { ?><img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "post_image_value", $single = true); ?>&w=98&h=98&zc=1&q=95" alt="<?php the_title(); ?>" /><?php } else if (get_post_meta($post->ID, 'post_image_value', true) && $mb_resize == 1) { ?><img src="<?php bloginfo('home'); ?><?php echo get_post_meta($post->ID, "post_image_value", $single = true); ?>" alt="<?php the_title(); ?>" /><?php } ?></a></div><?php } ?>
<?php the_excerpt() ?>
<p><a href="<?php the_permalink() ?>" class="more">Continue reading...
</a></p>
</div>
<!-- /post -->
<?php endwhile; ?>
<?php $mb_recent = new WP_Query('cat=5' . $mb_blog . '&posts_per_page=1' . $mb_blog_home . ''); ?>
<?php while ($mb_recent->have_posts()) : $mb_recent->the_post(); $more = 0; ?>
<!-- post -->
<div class="post archive">
<div class="post-comments"><?php comments_popup_link('0', '1', '%'); ?></div>
<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
<div class="post-date"><?php the_time('l, F jS, Y') ?></div>
<?php if (get_post_meta($post->ID, 'post_image_value', true)) { ?><div class="post-tnail"><a href="<?php the_permalink() ?>"><?php if (get_post_meta($post->ID, 'post_image_value', true) && $mb_resize == 0) { ?><img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "post_image_value", $single = true); ?>&w=98&h=98&zc=1&q=95" alt="<?php the_title(); ?>" /><?php } else if (get_post_meta($post->ID, 'post_image_value', true) && $mb_resize == 1) { ?><img src="<?php bloginfo('home'); ?><?php echo get_post_meta($post->ID, "post_image_value", $single = true); ?>" alt="<?php the_title(); ?>" /><?php } ?></a></div><?php } ?>
<?php the_excerpt() ?>
<p><a href="<?php the_permalink() ?>" class="more">Continue reading...</a></p>
</div>