Yeah, it would be possible, you’ll need to learn about The Loop and query_posts over on the codex.
My loop is <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?> but the instruction on the codex has it listed differently.
I see that the theme I’m using (Connections) uses WordPress’s 1.2 loop. It seems like the instructions for creating multiple loops all apply to 1.5 loops. Can you point me to a specific page that explains how to do multiple loops with 1.2? Thanks,
Tom
My loop is <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
Nope, that’s just the first line of the Loop – even in WP 1.2 it is much longer!
Not too much documentation on WP 1.2. Why not just replace the old Loop with the 1.5 version – and you will find plenty of examples in the Codex how to use multiple Loops.
I would like to swap the old loop for the new, but I just tried it and it didn’t work. Let me know if I didn’t do something right.
On my home.php page, I highlighted my loop:
<?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
<div class=”post”>
<?php require(‘post.php’); ?>
<?php comments_template(); // Get wp-comments.php template ?>
</div>
<?php endforeach; else: ?>
<?php _e(‘Sorry, no posts matched your criteria.’); ?>
<?php endif; ?>
Then I replaced it with the 1.5 loop:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php endwhile; else: ?>
<?php _e(‘Sorry, no posts matched your criteria.’); ?>
<?php endif; ?>
When I viewed the site with the new loop, no posts appeared. What am I forgetting to do here?
You mean you have just this:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php endwhile; else: ?>
<?php _e('Sorry, no posts matched your criteria.'); ?>
<?php endif; ?>
without any template tags in between? Then no wonder nothing shows up.
This is a complete Loop with template tags (the template tags call the any content from the DB)
http://www.transycan.net/abc/loop.phps
Oh, I see. I tried doing that and I think I got it to work. Now I just need to experiment with putting the loop inside table cells. I want my 5 main categories to be divided up like this: http://www.rockleybulletin.com/
Any tips for me?
5 loops. See the Multiple Loops examples > The_Loop.
Alternatively, get familiar with the Template_Tags/query_posts.