我不是什么PHP开发人员(主要是前端开发人员),我正在努力获得一个自定义的分类术语来显示使用该术语的所有帖子。
事情是这样的。我有:1。自定义职位类型(律师)2。该职位类型(实践领域)的自定义分类3。特定分类术语(上诉)
我需要显示所有使用自定义分类法“实践领域”中“上诉”一词的“律师”帖子。这将显示在索引页面上,因此我需要具体说明查询。
这是我现在的循环:
$loop = new WP_Query(
array(
\'post_type\' => \'attorneys\',
\'tax_query\' => array(
\'taxonomy\' => \'practice-areas\',
\'field\' => \'term_id\',
\'terms\' => \'appeals\',
)
)
);
if ( $loop->have_posts() ) :
while ( $loop->have_posts() ) : $loop->the_post(); ?>
// Get the content the_content;
//Blah blah blah close loop
?>