Show post two by two in a division
-
Hi guys,
I got a small problem on my project.
I need to do a small slider wich shows some post of X category. On each “slide”, I need to show two post and so on.
For the moment, I got this code, but it doesn’t works.
// The Query query_posts('cat=5'); // Test $i = 0; // The Loop while ( have_posts() ) : the_post(); ?> <div class="box-ticker"> <a href="#"><img class="ticker_texte" src="<?php bloginfo('template_url'); ?>/images/index/img-test.gif" alt=""/></a> <span class="caption-ticker"><?php echo the_title(); ?></span> </div> <? endwhile; // Reset Query wp_reset_query(); ?>
What I would like to do is something like this :
-Make the query -- Create a <div> with an unique ID (mydiv1) --- Show the first two posts -- Close <div> -- Creation a <div> with an unique ID (mydiv2) --- Show the second two posts -- Close <div> - end query
I’m not sure if this is super clear, but is somebody ever felt on a problem like mine? I really need help ??
Thx in advance
- The topic ‘Show post two by two in a division’ is closed to new replies.