<?php //ターム名リンク無しで取得
$terms = get_the_terms($post->ID, 'art_name');
$names = array();
echo ""; //前の文字
foreach ( $terms as $term ) {
$names[] = $term->slug; //[]にしまうってこと!
}
?>
<?php
$r_posts1 = $cfs->get('kanren_art');
if ($r_posts1) :
?>
<div class="top_titol" style="font-size:24px;">関連アーティースト</div>
<div class="top_new_item_all">
<?php
endif;
?>
<?php //---------------------------------------------関連イベント
$args = array(
'posts_per_page' => -1,
//'orderby' => 'menu_order',
//'order' => 'ASC',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'art_name',
'field' => 'slug',
'terms' => array($names[0],$names[1],$names[2],$names[3],$names[4],$names[5],$names[6],$names[7],$names[8],$names[9],$names[10]),
//'operator'=>'NOT IN'
),
),
'post_type' => 'support_artists', //カスタム投稿名
);
?>
<?php
query_posts( $args );
?>
<?php
if ( have_posts () ) :
while ( have_posts() ) :
the_post();
?>
<a href="<?php the_permalink(); ?>"><div class="artists_box">
<div class="artist_sam">
<?php //写真1枚----------------------------
$title= get_the_title();
$attachment_id = $cfs->get('w126');
$sample_photo = wp_get_attachment_image($attachment_id, 'W126',0,array('alt'=>$title,'title'=>$title));
echo $sample_photo;
?></div>
<div class="artist_disp">
<div class="artist_name"><?php the_title(); ?></div>
<div class="artist_area"><?php echo nl2br(get_post_meta($post->ID,"chiiki",true)); ?></div>
</div>
</div></a>
<!--/Aritist_box-->
<?php
endwhile;?>
<br clear="all" />
</div>
<?php
endif;
?>
<?php wp_reset_query(); ?>