Joe*_*Joe 5 wordpress pagination custom-post-type
我试图wp pagenavi在WordPress中使用插件和自定义帖子类型(组合页面)进行分页,我没有运气.
这是我的投资组合页面的精简版:
<?php get_header(); ?>
<?php
$type = 'portfolio';
$args=array(
'post_type' => $type,
'post_status' => 'publish',
'paged' => $paged,
'posts_per_page' => 1,
'caller_get_posts'=> 1
);
$temp = $wp_query; // assign original query to temp variable for later use
$wp_query = null;
$wp_query = new WP_Query($args);
?>
<?php if($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post(); ?>
...
<?php endwhile; else : ?>
...
<?php endif; ?>
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
$wp_query = null; $wp_query = $temp; ?>
<?php get_footer(); ?>
Run Code Online (Sandbox Code Playgroud)
我的永久链接设置为:
/%postname%/
Run Code Online (Sandbox Code Playgroud)
我已经重新保存了它们.
当我到达我的投资组合的第二页时,我得到一个404页面.知道为什么会这样吗?
谢谢您的帮助.
| 归档时间: |
|
| 查看次数: |
6995 次 |
| 最近记录: |