term_id; } } if ( empty( $categoryids ) ) { return; } $args = array ( 'posts_per_page' => 8, 'post__not_in' => array($post->ID), 'category__in' => $categoryids, 'orderby' => 'rand', 'ignore_sticky_posts' => 1 ); $related_query = new WP_Query($args); do_action( 'brainpress_parts_related_before' ); ?>