Friday, September 2, 2022
HomeWordPress Developmentloop - How dwelling my code would not show any function picture?...

loop – How dwelling my code would not show any function picture? Looping by means of submit from a taxonomy and never getting function photos again


The one factor I’m attempting to do is simply to show every submit from Companies that belongs to the taxonomy referred to as ‘nationwide’ and show its title and its featured picture. To this point it shows every title accurately however for some purpose Featured photos are merely not working.

<div class="container">
    <div class="row d-flex justify-content-center">
        <?php
        $args = array(
            'post_type' => 'providers',
            'posts_per_page' => 30,
            'state' => 'nationwide'
        );
        $the_query = new WP_Query( $args ); ?>
        <?php if ( $the_query->have_posts() ) : ?>
        <?php whereas ( $the_query->have_posts() ) : $the_query->the_post(); ?>

                <div class="col-md-3">
                    <?php the_post_thumbnail(); ?>
                    <?php the_title( '<h2>', '</h2>' ); ?>
                </div>
        <?php endwhile; ?>
        <?php endif ?>
  </div>
</div>

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments