3, 'post__not_in' => array( get_the_ID() ), 'no_found_rows' => true, ); $cats = wp_get_post_terms( get_the_ID(), 'category' ); $abc = array(); foreach( $cats as $ms_cat ) { $abc[] = $ms_cat->term_id; } if ( ! empty( $abc ) ) { $args['category__in'] = $abc; } $ms_query = new wp_query( $args ); ?>

have_posts() ): while( $ms_query->have_posts() ): $ms_query->the_post(); ?>