I
I
it_pear_yurec2018-06-26 19:33:55
WordPress
it_pear_yurec, 2018-06-26 19:33:55

Why aren't posts being displayed through the have_posts() loop?

Posts are not displayed through have_posts (), through get_post everything is displayed perfectly.

<?php if (have_posts()) { while (have_posts()) { the_post(); ?>
    <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
      <div class="catalogSec-Item">
        <div class="catalogSec-img">
          <?php the_post_thumbnail( 'thambnail' ) ?>
        </div>
        <div class="catalogSec-descript">
          <p class="catalogSec-descript__name"><?php the_title(); ?></p>
          <p class="catalogSec-descript__functional"><?php the_category( $separator = '/', ''); ?></p>
          <p class="catalogSec-descript__price">2 990 Руб.</p>
        </div>
        <div class="catalogSec-descript-btn">
          <a href="<?php the_permalink(); ?>" class="btn-blue catalogSec-descript__btn">Купить</a>
        </div>
      </div>
    </div>
  <?php } // конец while

  }  // конец if  ?>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question