term_id; $cat_name = $category[0]->cat_name; $current_post_id = get_the_ID(); $related_post_title = get_theme_mod( 'related_post_title' ); $query = new WP_Query( array ( 'post_type' => 'post', 'post__not_in' => array($current_post_id), 'showposts' => 3, 'orderby' => 'post_date', 'order' => 'DESC', 'cat' => $cat_id, 'ignore_sticky_posts' => true, )); // If post is there if( $query->have_posts() ) { ?>