有没有办法像wp_list_pages那样获取我定义的特定自定义页面类型的所有页面的列表?
非常感谢, 斯科特
答案 0 :(得分:1)
如何使用wp_query的变体生成列表?
<?php $mylist = new WP_Query( array( 'post_type' => 'mycustompagetype', 'posts_per_page' => 99 ) ); ?>
<?php while ( $mylist ->have_posts() ) : $mylist ->the_post(); ?>
<?php the_title( '<li><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></li>' ); ?>
<?php endwhile; ?>
认为这会吗?