我向注册了自定义帖子类型(foo)register_post_type
, 背景\'hierarchical\' => true,
所以现在我想用的时候post_type=foo
.
如何查询foo的子级?有什么想法吗?
谢谢
我向注册了自定义帖子类型(foo)register_post_type
, 背景\'hierarchical\' => true,
所以现在我想用的时候post_type=foo
.
如何查询foo的子级?有什么想法吗?
谢谢
您可以使用以下代码(使用父页面ID)显示特定父foo页面的子页面:
$the_query = new WP_Query( \'post_type=foo&post_parent=93\' );
// The Loop
while ( $the_query->have_posts() ) :
$the_query->the_post();
echo \'<li>\' . get_the_title() . \'</li>\';
endwhile;
当用户从下拉列表中选择特定类别时,将显示多个帖子类型的列表。我想用标题中的帖子类型标题分组显示数据。我不确定如何划分为岗位类型组。我花了一点时间寻找,但没有找到我真正需要的东西。我还试图添加<?php $post_type = get_post_type( $post->ID ); echo $post_type; ?> 但这只是重复(显然)。调用循环<div id=\"content\" role=\"main\" style=\"float:right; width:765px