下面显示自定义分类法中的父术语,然后显示子术语,最后显示附加到每个术语的帖子的帖子链接(自定义帖子)。因此:
父级
子1.1后1.2后2.1后等。但是,查询未返回任何帖子。如果有人能指出问题的根源,我将不胜感激。为简洁起见,我省略了此代码之前的变量设置列表
echo("<h3 class=\'chapter-header\'id=\'".$chapterNumber."\'>". $chapter_info->name . "</h3>");
echo("<div class=\'section\' id=".$in_chapter.">"); // Start sections Div.
foreach ($sections as $section){
echo("<h3 class=\'section-header\'>". $section->name."</h3>");// Display Section Name
$pagequery=NULL;
$postqueryargs = array(
\'post_type\'=>\'book\',
\'taxonomy\'=> $taxonomy,
\'terms\'=> $section->slug
);
$pagequery = new WP_Query($postqueryargs);
echo("<div class=\'pages\'>");// Start pages div
echo("<ul>");
if($pagequery->have_posts()){
while ($pagequery->have_posts()):$pagequery->the_post();
echo(\'<li><a href=" \'.get_permalink().\'" rel="bookmark" title="Permanent Link to \'. get_the_title().\'" >\' .get_the_title() . \'</a></li>\');
endwhile;}
else{
echo("No Pages Yet In This Chapter");
}
echo("</ul>");
echo("</div>");/* End pages */
}// End foreach - Sections
echo("</div>");/* End section */