3, 'orderby' => 'rand', 'post__not_in' => array( get_the_ID() ), ); $cafeteria_elementor_tax_terms = wp_get_post_terms( get_the_ID(), 'category' ); $cafeteria_elementor_terms_ids = array(); foreach( $cafeteria_elementor_tax_terms as $tax_term ) { $cafeteria_elementor_terms_ids[] = $tax_term->term_id; } $cafeteria_elementor_post_args['category__in'] = $cafeteria_elementor_terms_ids; $cafeteria_elementor_related_posts = new WP_Query( $cafeteria_elementor_post_args ); if ( $cafeteria_elementor_related_posts->have_posts() ) : ?>

have_posts() ) : $cafeteria_elementor_related_posts->the_post(); ?>