So I’m trying to build a list based on the last 12 posts.
I thought I could include something like this in Single.php page:
<?php query_posts('category_name=volunteerspotlights&showposts=12&orderby=date&order=DESC'); echo '<ul style="list-style: none;">'; while (have_posts()) : the_post(); echo '<li style="width: 50%; float: left;"><a href="'. get_permalink() . '"><div style="font-size: 14px; font-weight: bold;">' . get_the_title() . '</div><div class="archiveName">' . get_the_date('F') . '</div></a></li>'; endwhile; echo '</ul>'; ?>
But as soon as I put that query_posts line in, the posts will no longer load, the browser just loads forever as if I am in an infinite loop or something. Anyone have any suggestions?
- The topic ‘Trying to query posts in single.php and the posts never load – infinite loop?’ is closed to new replies.