Guest User

Untitled

a guest
Jan 15th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. <?php $loop = new WP_Query( array( 'post_type' => 'portfolio' ) ); ?>
  2. <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
  3. <div class="four columns">
  4. <?php the_content(); //along with other stuff in looped div ?>
  5. </div>
  6. <?php endwhile ?>
  7.  
  8. <?php $counter = 1 ?>
  9. <?php $loop = new WP_Query( array( 'post_type' => 'portfolio' ) ); ?>
  10. <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
  11. <div class="four columns <?php if ($counter % 4 == 1){echo 'alpha'}else if ($counter % 4 == 0){echo 'omega'} ?>">
  12. <?php the_content(); //along with other stuff in looped div ?>
  13. </div>
  14. <?php $counter++ ;
  15. endwhile ?>
  16.  
  17. <?php $loop = new WP_Query( array( 'post_type' => 'portfolio' ) ); ?>
  18. <?php
  19. $i = 0;
  20. while ( $loop->have_posts() ) : $loop->the_post();
  21. if( $i % 4 == 0 )
  22. $class = 'omega';
  23. else
  24. $class = '';
  25. ?>
  26. <div class="four columns <?php echo $class ?>">
  27. <?php the_content(); //along with other stuff in looped div ?
  28. $i++;
  29. >
  30. </div>
  31. <?php endwhile ?>
  32.  
  33. div#test > *:nth-child(4n+4) {
  34. color: red;
  35. }
Add Comment
Please, Sign In to add comment