V
V
Vadim Sverdlik2020-05-28 18:42:45
JavaScript
Vadim Sverdlik, 2020-05-28 18:42:45

How to correctly display a cycle of records of 2 or 3 records in one slide?

5ecfdb29bfa72668217208.png

According to the layout, the task is such a carousel, as on the screen. I put Slick Slider, now I'm thinking how best to display it. I have a standard post cycle

<div class="videos-carousel-main-mobile visible-mobile">
                   <section class="lazy slider" data-sizes="50vw">
                       <?php
                       $the_query = new WP_Query( 'showposts=8' ); ?>
                       <?php while ($the_query -> have_posts()) : $the_query -> the_post();
                           $cat = get_the_category();
                           $cat_ID= $cat[0]->term_id; ?>
                           <div class="main-video-slide">
                               <div class="video-category">
                                   <a href="<?php the_permalink() ?>">
                                       <?php if(get_the_post_thumbnail_url($post->ID)) echo get_the_post_thumbnail( $attr); else echo ' <img alt="#" src="http://blogprogram.ru/wp-content/uploads/2016/05/noimg.png">'; ?>
                                       <svg viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg">
                                           <circle cx="21" cy="21" r="20.5" stroke="white"/>
                                           <path d="M29.25 20.567C29.5833 20.7594 29.5833 21.2406 29.25 21.433L15.75 29.2272C15.4167 29.4197 15 29.1791 15 28.7942L15 13.2058C15 12.8209 15.4167 12.5803 15.75 12.7728L29.25 20.567Z" stroke="white"/>
                                       </svg>
                                   </a>
                               </div>
                               <div class="video-post-text-name"><a href="<?php the_permalink() ?>" class="video-post-text"><?php the_title(); ?></a></div>
                           </div>

                       <?php endwhile;?>

                   </section>
               </div>


it displays one entry per slide, but what is the best way to make 2 or 3 entries per slide?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2020-05-28
@wppanda5

Counter and modulo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question