您正在引用主查询,因此它很可能只是试图显示“posts”,而不是您的自定义post类型。
不知道你的确切格式是什么,但我会重做查询,以便-
$args = Array( // Array of arguments for query_posts()
\'numberposts\' => -1,
\'posts_per_page\' => get_option(\'posts_per_page\'),
\'paged\' => $paged,
\'post_type\' => array(\'your-post-type-slug\', \'another-post-type-slug-if-you-want\')
);
query_posts($args);
这意味着您的代码将成为-
<?php
global $wp_query; // You don\'t need this if you are not in a function, so can probably be removed.
$args = Array( // Array of arguments for query_posts()
\'numberposts\' => -1,
\'posts_per_page\' => get_option(\'posts_per_page\'),
\'paged\' => $paged,
\'post_type\' => array(\'your-post-type-slug\', \'another-post-type-slug-if-you-want\')
);
query_posts($args);
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
\'base\' => str_replace( $big, \'%#%\', get_pagenum_link( $big ) ),
\'format\' => \'?paged=%#%\',
\'current\' => max( 1, get_query_var(\'paged\') ),
\'total\' => $wp_query->max_num_pages )
);
?>