我想创建一个页面模板文件来显示来自自定义内容类型的帖子。我正在使用从中找到的代码this site, 但它什么也没有呈现。有人知道问题出在哪里吗?
<?php /* Template Name: Custom Post Type Archive */
get_header(); ?>
<?php
global $query_string;
query_posts($query_string . "post_type=YOUR-CUSTOM-POST-TYPE&post_status=publish&posts_per_page=10");
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
<?php endwhile;
endif; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link(\'Previous entries\') ?></div>
<div class="alignright"><?php previous_posts_link(\'Next entries\') ?></div>
</div>
<?php wp_reset_query(); ?>
<?php get_sidebar(); ?>
<?php get_footer();?>