Would this be the best way to
1. Display the content for the page
2. Under page content display all posts (or thumbnails from posts) from a specific category
Forgive me if my code is sloppy. If there is a better way to do this, I am very eager to learn. There will probably be 30+ categories when the site is completed.
<?php get_header(); ?>
<div id="outerWrapper">
<div id="pageContent">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2>
<?php the_title(); ?>
</h2>
<?php the_content(); ?>
<?php endwhile; endif; ?>
<?php query_posts('category_name=cold-casting'); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="pages"> <a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(); ?>
</a> </div>
<?php endwhile;?>
<div class="clear"></div>
</div>
</div>
<?php query_posts('category_name=casting'); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="pages"> <a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(); ?>
</a> </div>
<?php endwhile;?>
<div class="clear"></div>
</div>
</div>
<?php get_footer(); ?>
You should use wp_query instead, It gives cleaner code IMO. But either way, you don’t have to have two different loops for the categories, you could just send in both of them at once.
query_posts(‘category_name=cold-casting,casting’);
And as Nikola said, add a wp_reset_query(); after your custom queries.