I'm trying this:
<?php query_posts('cat=6'); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div>
<?php $counter=3; ?>
<?php the_post_thumbnail(); ?>
<?php $counter++; ?>
</div>
<?php endwhile; ?>
<?php endif; ?>
But it's not working! :/ Thank you!
Thanks for your support guys! :) I tried both solutions but didn't work, I ended up with this and works perfectly!
<?php query_posts('cat=6'); ?>
<?php $variable=0;?>
<div>
<?php while ( have_posts() ) : the_post(); ?>
<?php if(($variable+1)<4){ ?>
<a href="<?php echo get_post_meta($post->ID, 'colaborador-link', true); ?>" target="blank">
<?php the_post_thumbnail(); ?>
</a>
<?php $variable+=1; ?>
<?php }else{ ?>
<?php $variable=1; ?>
</div>
<div>
<a href="<?php echo get_post_meta($post->ID, 'colaborador-link', true); ?>" target="blank">
<?php the_post_thumbnail(); ?>
</a>
<?php }?>
<?php endwhile; ?>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With