My code below is getting data from the category with ID 5. Inside the if statement I want to be able to check for the sub categories with an ID of 8. How do I do this?

        <div class="row no-gutters">
                $args = array(
                    'post_type' => 'customers',
                    'post_status' => 'publish',
                    'posts_per_page' => -1, 
                    'orderby' => 'title', 
                    'order' => 'ASC',
                    'cat' => '5',

                $the_query = new WP_Query( $args );
                $found_posts = $the_query->found_posts;
            <?php if ( $the_query->have_posts() ) : ?> 

                <?php echo do_shortcode('[ajax_load_more loading_style="infinite skype" theme_repeater="embryos-loop.php" post_type="customers" posts_per_page="3" category="embryos-and-straws"]'); ?> 

            <?php endif; ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.