ID);
if ($categories):
$cat_ids = array();
foreach ($categories as $category):
$cat_ids[] = $category->term_id;
endforeach;
$args = array(
'category__in' => $cat_ids,
'post__not_in' => array($post->ID),
'posts_per_page' => 2, // Number of related posts to display.
'ignore_sticky_posts' => 1,
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array(
'post-format-quote',
'post-format-aside',
'post-format-status',
'post-format-chat',
'post-format-link',
'post-format-audio',
),
'operator' => 'NOT IN',
),),);
$query = new WP_Query( $args );
if($query->have_posts()):?>