1

Как использовать в цикле wordpress карусель owl carousel? Вот так не получается.

					<div class="main_carousel">

<?php if(have_posts()) : ?> 
<?php while ( have_posts() ) : the_post(); ?>

						<div class="carousel_item">
							<img src="<?php echo esc_url( get_template_directory_uri() ); ?>/img/slider-img.jpg" alt="Alt">
							<div class="news_wrap">
								<div class="news_block">
									<h3>Lorem</h3>
									<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt expli</p>
									<div class="newsb"><i class="fa fa-3x fa-angle-right"></i></div>
								</div>
							</div>
						</div>

<?php endwhile; ?>   
<?php endif; ?>

					</div>

1
  • В каком цикле? Что Вы хотите чтобы получалось на выходе? Подробнее пожалуйста 31 дек 2015 в 11:37

1 ответ 1

1

Получилось!

<div class="main_carousel">

  <?php $args=array( 'cat'=>'6'); query_posts($args); while ( have_posts() ) : the_post(); ?>

  <div class="carousel_item">
    <img src="<?php the_field('slider_news_img'); ?>" alt="Alt">
  </div>

  <?php endwhile; wp_reset_query(); ?>
  <?php $wp_query1=$ temp_query1; ?>


</div>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.