在'foreach'循环期间,如果检测到相同的术语,则只添加页面链接,否则在单个wp_query期间添加术语名称和页面链接?
例如:
应该成为:
<?php
$alternate_edition_a = array(
'post_type'=> 'alternate_edition',
'post_status' => 'publish',
'posts_per_page'=>10,
'no_found_rows' => true,
'tax_query' => array(
array(
'taxonomy' => 'game_titles',
'field' => 'slug',
'terms' => $gametitle_con,
)
)
);
$alternate_edition_query = new WP_Query( $alternate_edition_a );
if($alternate_edition_query->have_posts() ) : while ( $alternate_edition_query->have_posts() ) : $alternate_edition_query->the_post();
$alternate_editionTitlesID[] = get_the_ID();
$systemformats_altedition_terms = get_the_terms($post->id, 'system_formats');
foreach ($systemformats_altedition_terms as $systemformats_altedition_term) {
if (!has_term($systemformats_altedition_term->slug, 'system_formats', $gameFeatTitleID)) {
$systemterm_slug[] …Run Code Online (Sandbox Code Playgroud)