ID ); $category = array(); if( $cats ){ foreach( $cats as $cat ){ $category[] = $cat->term_id; } } $related_posts_query = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => 6, 'post__not_in' => array( $post->ID ), 'category__in' => $category ) ); $ed_related_post = absint( get_theme_mod( 'ed_related_post',$default['ed_related_post'] ) ); if( $ed_related_post && $related_posts_query->have_posts() ): ?>