WordPress的 - 从子类别列出的自定义帖子类型
问题描述:
我有一个自定义的帖子类型称为my-plays,在其中我创建了类别短剧和长戏。我希望能够输出每个类别中的帖子列表......目前我只能找到只输出my-plays中所有帖子列表的代码。是否可以在自定义帖子类型的类别中列出帖子?WordPress的 - 从子类别列出的自定义帖子类型
答
取自here。
<?php
$args = array
(
'numberposts' => 3,
'category' => array(48,43,49,46,47,44,51,50,42),
'orderby' => 'post_date',
'order' => 'ASC',
'post_type' => 'post',
'post_status' => 'publish'
);
query_posts($args);
?>
<?php while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php endwhile; ?>
这并不完全工作...如果我把post_type为“我的播放次数”,那么它就是列表所有自定义后类型的职位,但进入我的类ID(或“tag_IDs “因为他们现在是)不会从那里过滤它,它只是不断列出所有这些。 – Tim