我似乎无法实现这一点,我已经尽了我所能,并花了足够的时间在谷歌上搜索,让我到其他地方寻求帮助。
我需要在循环中查询页面,使用与当前页面相同的分类法,但使用当前页面术语的子术语。
例如
taxonomy = walls
current page term = art
queried pages taxonomy = art
queried pages term= modern-art ( where art is the parent term of modern-art)
 我可以使用
$args = array(
  \'post_type\' => \'page\'
  \'orderby\' => \'menu_order\',
  \'order\'=>\'ASC\',
  \'tax_query\'   => array(
        array(
            \'taxonomy\' => \'walls\',
            \'field\'    => \'slug\',
            \'terms\'    =>  \'modern-art\'
       )
    )
 然而,我需要这段代码是动态的并获取数据。因此,我可以使用相同的模板,包含许多不同的父项和子项。