代码分页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