在任意位置列出自定义文章类型

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在任意位置列出自定义文章类型相关的知识,希望对你有一定的参考价值。

Useful for adding Custom Post types to navigation this will list all custom post type posts
  1. <?php query_posts( array( 'post_type' => 'Beers', 'showposts' => 10 ) );
  2. if ( have_posts() ) : while ( have_posts() ) : the_post();
  3. ?>
  4. <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
  5.  
  6. <?php endwhile; endif; wp_reset_query(); ?>

以上是关于在任意位置列出自定义文章类型的主要内容,如果未能解决你的问题,请参考以下文章