Created
June 12, 2019 10:30
-
-
Save farik92/8198f0faa6d81744754fba64e22e7664 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php query_posts('post_type=post'); ?> | |
| <?php $variable=0;?> | |
| <div class="carousel-item active"> | |
| <div class="service_row row"> | |
| <?php while ( have_posts() ) : the_post(); ?> | |
| <?php if(($variable+1)<5){ ?> | |
| <div class="col-lg-3 col-md-6"> | |
| <div class="service_row__col "> | |
| <div class="pimage"> | |
| <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?> | |
| </div> | |
| <h2 class="service_row__title"><?php the_title(); ?></h2> | |
| </div> | |
| </div> | |
| <?php $variable+=1; ?> | |
| <?php }else{ ?> | |
| <?php $variable=1; ?> | |
| </div> | |
| </div> | |
| <div class="carousel-item"> | |
| <div class="service_row row"> | |
| <div class="col-lg-3 col-md-6"> | |
| <div class="service_row__col "> | |
| <div class="pimage"> | |
| <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?> | |
| </div> | |
| <h2 class="service_row__title"><?php the_title(); ?></h2> | |
| </div> | |
| </div> | |
| <?php }?> | |
| <?php endwhile; ?> | |
| </div> | |
| </div> | |
| <?php wp_reset_query(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment