我尝试使用wp\\u list\\u categories,但这只是一个类别列表。我目前在我的分类食谱中有此代码。php文件:
<ul class="subcats-list">
<h2 class="subcats-title"><?php echo get_cat_name(38); ?></h2>
<?php
$recipes = new WP_Query();
$recipes->query(\'showposts=5&orderby=rand&cat=38&post_type=recipe\');
while ($recipes->have_posts()) : $recipes->the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul><!-- subcat -->
我在考虑在get_cat_name
但我不知道该包括什么。