multiple loops
-
Hi, I want to have 2 loops on my index page. The first one has to show 4 post form a certain category, and the second one 10 post from another category.
I’ve tried with query_post and $my_query, but they don’t seems to work. This is how my code looks like:<?php query_posts('category_name=appuntamenti&showpost=4'); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="headlines">
<?php the_time('d/m/Y') ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<?php the_title(); ?>
</a></div>
</div>
<?php endwhile;?>
<!-- loop 2-->
<div class="loop"><img src="https://demon.wererabbit.net/wp-content/themes/demon/images/notiziepubbliche.gif"></div>
<?php query_posts('category_name=notizie&showpost=10'); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<?php the_title(); ?>
</a></h1>
<?php the_time('F jS, Y') ?>
<!-- by <?php the_author() ?> -->
<div class="entrytext">
<?php the_excerpt('Read the rest of this entry »'); ?>
</div>
</div>
<?php endwhile; ?>
- The topic ‘multiple loops’ is closed to new replies.