get_theme_mod( 'automobile_hub_related_post_per_page', 3 ), 'orderby' => 'rand', 'post__not_in' => array( get_the_ID() ), ); $automobile_hub_number_of_post_columns = get_theme_mod('automobile_hub_related_post_per_columns', 3); $automobile_hub_col_lg_post_class = 'col-lg-' . (12 / $automobile_hub_number_of_post_columns); $related = wp_get_post_terms( get_the_ID(), 'category' ); $automobile_hub_ids = array(); foreach( $related as $term ) { $automobile_hub_ids[] = $term->term_id; } $automobile_hub_post_args['category__in'] = $automobile_hub_ids; $related_posts = new WP_Query( $automobile_hub_post_args ); if ( $related_posts->have_posts() ) : ?>