1
雖然在這篇博客中有4篇文章,但我只希望顯示三篇文章,正常工作http://bit.ly/sFcp4D。但是,當你點擊下一個和上一個按鈕時,它將移動到下一個帖子。我不確定爲什麼這不動。任何人都可以擺脫這種情況,謝謝。分頁新聞頁面無法正常工作
<!--BEGIN CONTENT-->
<article id="content">
<?php if (have_posts()) : the_post(); ?>
<div class="post post-page" id="post-<?php the_ID(); ?>">
<div class="post-content our-news">
<?php the_content(); ?>
<?php
$page = get_query_var('page');
query_posts(array('category_name' => 'Our News', 'posts_per_page' => 3, 'paged' => $page));
?>
<ul id="news">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<li class="post" id="post-<?php the_ID(); ?>">
<div class="box">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
<?php the_post_thumbnail('portfolio-thumb'); ?>
</a>
</div>
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<span><?php the_time('F jS Y') ?></span>
<div class="entry">
<?php the_content(); ?>
</div>
</li>
<?php endwhile; ?>
<div class="clear">
</ul>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('<<', 3) ?></div>
<div class="alignright"><?php previous_posts_link('>>', 3) ?></div>
</div>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php endif; ?>
<?php wp_reset_query(); ?>
<?php wp_link_pages(array('before' => '<div class="page-link">' . __('Pages:', 'HAWK_FRONT'), 'after' => '</div>')); //end link page ?>
<?php edit_post_link(__('Edit', 'HAWK_FRONT'), '<div class="edit-link">', '</div>'); //end edit link ?>
</div>
<!--end post page-->
<?php else : ?>
<!--BEGIN NO POST-->
<div class="no-post">
<h2><?php esc_html_e('Not Found', 'HAWK_FRONT'); ?></h2>
<p><?php esc_html_e("Sorry, but you are looking for something that isn't here.", 'HAWK_FRONT'); ?></p>
</div>
<!--END NO POST-->
嗨馬修我設法得到這個排序,謝謝。 –