Skip to content

Instantly share code, notes, and snippets.

@sagarjadhav
Last active August 29, 2015 13:57
Show Gist options
  • Save sagarjadhav/9762637 to your computer and use it in GitHub Desktop.
Save sagarjadhav/9762637 to your computer and use it in GitHub Desktop.
Carousel: open and close the slide wrapper depends on count
<?php
$count = 0;
$count_2 = 0;
$total_count = count( $post );
if( $count == 0 ) {
echo '<div>';
}
if( $count == 2 || ( $total_count % 2 != 0 && $total_count == $count_2 ) ) {
echo '</div>';
$count = 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment