Duplicating post
-
Im using a loop with 3 posts per row.Right now, shows the firsts 3.
<div id=”gridcontainer”>
<?php
$counter = 1;$grids = 3;
global $query_string;
query_posts($query_string . ‘&caller_get_posts=1&posts_per_page=3’);
if(have_posts()) : while(have_posts()) : the_post();
?>
<?phpif($counter == 1 || $counter == 2):
?>
<div class=”griditemleft”>
<div class=”postimage”>
” title=”<?php the_title_attribute(); ?>”><?php the_post_thumbnail(‘category-thumbnail’); ?>
<h1>” title=”<?php the_title_attribute(); ?>”><?php the_title(); ?></h1>
</div>
</div>
<?php
elseif($counter == $grids) :
?>
<div class=”griditemright”>
<div class=”postimage”>
” title=”<?php the_title_attribute(); ?>”><?php the_post_thumbnail(‘category-thumbnail’); ?>
<h1>” title=”<?php the_title_attribute(); ?>”><?php the_title(); ?></h1>
</div></div>
<div class=”clear”></div>
<?php
$counter = 0;
endif;
?>
<?php
$counter++;
endwhile;
//wp_pagenavi();
endif;
?></div><!–FIN gridcontainer–>
Doesn′t matter what parameters using on the shortcode builder, allways shows and duplicate several times the first 3 posts.
It tried offset:1,2,3,4,5… and nothing, i can not be able to solve it. What am i doing wrong?
- The topic ‘Duplicating post’ is closed to new replies.