代碼分頁Wordpress中的自定義帖子類型分頁不工作?在自定義類型的職位
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; // For pagination
$loop = new WP_Query(array('post_type' => 'Portfolio','posts_per_page' => 3,'orderby'=> 'menu_order',
'paged'=>$paged)); ?> //For implementing pagination
<?php if ($loop->have_posts()): ?>
<?php while ($loop->have_posts()) : $loop->the_post(); ?> <div id="latestproimg">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<?php the_post_thumbnail('large', array('title' => false)); ?></a>
</div>
<div id="latestpostser">
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark">
<?php echo get_the_title(); ?></a></h2> //displaying the title
<?php //echo get_the_excerpt(); ?>
<?php //the_content('Read the full post »'); ?> // for displaying the content
</div>
<div class="clr"></div>
<?php endwhile;
endif; ?>
請告訴我哪裏是在代碼中的錯誤
這幾個月前爲我工作的一部分,出於某種奇怪的原因,我還必須將存儲查詢的對象重命名爲「$ the_query」。 – ninja
所以當你重命名它它工作? – loQ