I have a question. I put the code just below before starting a while
but inside the loop, when calling array_shift($cores)
, it applies the classes while loop is <=
that the amount of indexes, that is, índice 4
it no longer applies more classes.
If I then put 10 items inside the loop, 6 will get classless some probably because this statement puts index without repeating it.
$cores = ["primary", "secondary", "tertiary", "quaternary"];
shuffle($cores);
LOOP
if ( $empr->have_posts() ) {
while ( $empr->have_posts() ) { $empr->the_post(); ?>
<div class="team-item <?php echo array_shift($cores); ?>"> ...
Question: How to continue applying the classes? An example can be viewed here in the in> OTHER DEVELOPMENTS .