게시물에서 많은 항목이있는 페이지가 있습니다.Wordpress : posts_nav_link() 도움말
한 번에 10 개의 게시물 만 표시하도록 설정했지만 이전/다음 버튼은 실제로 다음 또는 이전 게시물을 표시하지 않습니다. 단지 동일한 게시물을 계속 표시합니다.
function add_shop() {
if (is_page('shop') || is_page('7')) { ?>
<div id="content">
<div class="post_box">
<div id="column_1">
<div id="shop_wrapper">
<?php query_posts('tag=shop&orderby=title&order=ASC&posts_per_page=10');
if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="shop_item"> <a href="<?php getCustomField('link_to_project_page'); ?>"><img src="<?php getCustomField('shop_thumbnail_image'); ?>" alt='photo of <?php getCustomField('title'); ?>' class="shop_thumb" /></a>
<div class="shop_content">
<h4><a href="<?php getCustomField('link_to_project_page'); ?>">
<?php getCustomField('title'); ?>
</a></h4>
<?php getCustomField('duration'); ?>
<?php getCustomField('paypal_code'); ?>
</div>
</div>
<?php endwhile; ?>
</div>
<?php posts_nav_link(); ?>
</div>
<?php else : ?>
<h2>Not Found</h2>
<p>Sorry, but you are looking for something that isn't here.</p>
<?php include (TEMPLATEPATH . "/searchform.php"); ?>
<?php endif; ?>
</div>
</div>
<div id="sidebars">
<div id="sidebar_1" class="sidebar">
<ul class="sidebar_list">
<li class="widget">
<div class="widget_box">
<?php dynamic_sidebar(5); ?>
</div>
</li>
</ul>
</div>
</div>
<?php } }
난 그냥 나는 그것이 클리오 생각 ... 그 시도 하지만 아직 작동하지 않습니다. 오프셋을 설정해야 할지도 모르지만 그 방법에 대해서는 확실하지 않습니다. – redconservatory
음,'$ paged'는 오프셋을 나타내야합니다. 예를 들어 4 페이지를 보았다면'$ paged'의 값은 4가 될 것입니다.이 값을'posts_per_page'와 함께 사용하여 오프셋을 결정해야합니다. 지금 무엇을 얻고 있습니까? 어떤 글입니까? –