我有分类法=“本地”,术语:ABC(父)-HCM-Q1-Q2-Q3
我在single\\u post\\u类型中使用了代码:<?php echo get_the_term_list(get_the_ID(), \'local\', \'\', \', \', \'\'); ?>
但它是按字母显示的(ABC、HCM、Q1、Q2、Q3)。我想先显示子对象->父对象:Q1、Q2、Q3、HCM、ABC请帮助我!!!谢谢
我有分类法=“本地”,术语:ABC(父)-HCM-Q1-Q2-Q3
我在single\\u post\\u类型中使用了代码:<?php echo get_the_term_list(get_the_ID(), \'local\', \'\', \', \', \'\'); ?>
但它是按字母显示的(ABC、HCM、Q1、Q2、Q3)。我想先显示子对象->父对象:Q1、Q2、Q3、HCM、ABC请帮助我!!!谢谢
您可以在函数中添加以下代码。子主题或自定义插件的php文件
add_filter( "term_links-local", \'reverse_order\' );
function reverse_order($links)
{
$new = array_reverse($links);
return $new;
}
由于我使用cron作业进行自动化,因此在分类法方面遇到了一些问题。在使用cron作业之前,以下代码用于工作:$custom_tax = array( \"project-type\" => array( \"2\" ) ); $mypost = array( \'post_title\' => $basicdata[\"Model\"], \'post_type\' => \"port