在我的网站两个自定义帖子类型,一个是广告商和第二个是事件,我正在显示这两个CPT显示到一个滑块,而不是只有图像的内容。
在我的项目中创建了2个CPT,1)Advertiser 2)Reader我将这两个CPT内容放到一个滑块中
发布于 2014-11-22 19:36:35
<?php
// The Query
$queryslider= new WP_Query(array( 'post_type' => array( 'Advertiser', 'Reader' ), ));
query_posts( $queryslider);
// The Loop
while ( $queryslider->have_posts() ) : $queryslider->the_post();
echo '<li class="slide">';
the_title();
/* and other content what you want */
echo '</li>';
endwhile;
// Reset Query
wp_reset_query();
?>祝你好运!:)
https://stackoverflow.com/questions/27074996
复制相似问题