我是WordPress的新手,但请尝试将您的代码更改为:
<?php get_header(); ?>
<?php if ( have_posts() ) : ?>
<div id="content" class="group">
<?php get_sidebar(); ?>
<?php /* Start the Loop */ ?>
<?php $myQuery = new WP_Query(array(\'posts_per_page\' => 1));
while($posts_to_update ->have_posts()) : $posts_to_update ->the_post(); ?>
<div id="post_column">
<div class="post_entry group">
<div class="post_header"><h2><?php the_title(); ?></h2>
<?php the_content(); ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php get_footer(); ?>
UPDATE:另一种解决方案是在函数中添加此代码。php:
if ( is_home() ) {
// Display only 1 post for the original blog archive
$query->set( \'posts_per_page\', 1 );
return;
}