Created
April 25, 2017 08:36
-
-
Save ihorduchenko/36e5ded87b7a9d98be0c754fe7ba27cc to your computer and use it in GitHub Desktop.
Cross-browser loop using table
This file contains 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
$query = new WP_Query( $args ); | |
if ( $query->have_posts() ) { ?> | |
<table> | |
<?php $i = 0; | |
while( $query->have_posts() ) { | |
$query->the_post(); ?> | |
<?php if($i == 0){ echo "<tr>"; }?> | |
<td class="item_post_man"> | |
<a href="<?php echo get_permalink(); ?>"> | |
<?php if ( has_post_thumbnail() ) { | |
the_post_thumbnail('thumb_product_cat', array( 'class' => 'img-responsive' )); | |
} ?> | |
<p class="title_man"><?php the_title(); ?></p> | |
</a> | |
</td> | |
<?php $i++;?> | |
<?php if($i == 3){ echo "</tr>"; $i=0;}?> | |
<?php } ?> | |
</table> | |
<?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment