My second loop doesn’t work
-
Hi there!
I created a template for a page (wp static page) with two loops. The first loop will show the last post of the blog. The second loop will show the content of the page.
The first loop code goes like this;
<?php query_posts(‘posts_per_page=1’); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?><div…
<?php the_content()
<?php endwhile; ?>–> so far so good, it works! but then I insert the second loop and it doesn’t work. I must be missing anything;
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class=”post” id=”post-<?php the_ID(); ?>”>
<h2><?php the_title(); ?></h2>
<div class=”entrytext”>
<?php the_content(‘<p class=”serif”>read »’); ?><?php link_pages(‘Paginas: ‘, ”, ‘number’); ?>
</div>
</div>
<?php endwhile; endif; ?>
<?php edit_post_link(‘Edit.’, ”, ”); ?>–> What I’m doing wrong? I have read I need to re-set the second loop but not sure how to do it?
Please, help!
- The topic ‘My second loop doesn’t work’ is closed to new replies.