我有一個名爲「audio」的自定義帖子類型。要顯示頁面中的所有帖子,我寫了下面的代碼,但它不起作用。顯示頁面中的自定義帖子類型帖子
<?php
$post_type = "audioes";//post type names
echo "djnbfj";
$post_type->the_post();
// The Query
$the_query = new WP_Query(array(
'post_type' => $post_type,
'orderby' => 'post_date',
'order' => 'DESC',
'showposts' => 1,
));
// The Loop
?>
<?php
while ($the_query->have_posts()) : $the_query->the_post(); ?>
<div class="issue-content">
<?php get_template_part('includes/breadcrumbs', 'page'); ?>
<?php if (has_post_thumbnail()) { the_post_thumbnail();}
get_template_part('loop-audio', 'page');
?>
</div><!--issue-content-->
<?php endwhile; ?>
</div> <!-- end #left_area -->
我如何獲得帖子類型我想要上面寫的自定義的。
我的文章類型「audioes」。 – Ranjit