The Loop is your basic WordPress doodad. (Please do not be intimidated or alarmed by my command of fancy-pants terminology.) Its function is to retrieve and display the latest posts with the number of posts displayed per page set by the user in WordPress’ Admin page (Settings>Reading). I’ve got this blog currently set to display five posts per page.
A basic loop looks like this:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
BLAH BLAH BLAH
<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>
The BLAH BLAH BLAH is the section of the loop that determines how each post is displayed. In most themes, this will retrieve and display the title, date, time and author name along with the actual post content.
Now I’ve got a Web category on this blog that presents links I’ve found on the … Web. Rather than do the typical blog thing of grabbing an image and padding the entry with some snarky comments, I simply present these links with a brief one-line description if necessary.
I got it in my head that I would restyle the blog so that it handled these quick link entries differently from the rest of the blog. This involved three different tasks: excluding the Web category from the main loop, displaying the five latest posts in the Web category on the left sidebar and finally changing how posts are displayed when viewing the Web category.
Continued…