Hey thanks esmi,
I managed to change my posts on my home page to display only from a particular catagory, but I cant figure how to “reset” the loop counter and display that a different category again.
I changed the <?php query_posts(‘category_name=music&posts_per_page=10’); ?> so it grabs the music category, but how do I make it repeat this process and grab again?
here is the relevant code If it helps.
Thanks!
<div id="content">
<?php if (have_posts()) : $m = 1; ?>
<div id="mini-post-wrap" class="clearfix">
<?php query_posts('category_name=music&posts_per_page=10'); ?>
<?php rewind_posts(); ?>
<?php while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" class="mini-post<?php if ($m % 3 == 0) : echo ' last'; endif; ?>">
<div class="meta clearfix">
<span class="date-post">Posted on <?php the_time('F j Y') ?></span> <a class="read-more" href="<?php the_permalink() ?>" title="Keep Reading...">Read more...</a>
</div>
<?php $thumbnail = (get_post_meta($post->ID, 'thumbnail', $single = true)) ? '<img src="'.get_post_meta($post->ID, 'thumbnail', $single = true).'" width="400" height="186" alt="'.get_the_title($post->ID).'" />' : ''; ?>
<?php if ($thumbnail): $number = 55; ?>
<div class="thumbnail">
<?php echo $thumbnail; ?>
<?php else: $number = 100; endif; ?>
<h3 class="title"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<?php if ($thumbnail): ?>
</div>
<?php endif ?>
<div class="entry clearfix">
<?php the_excerpt('', TRUE, '', $number); ?>
</div>
</div>
<?php $m++; endwhile; ?>
</div><!-- /mini-post-wrap -->
<?php if(function_exists('wp_pagenavi')) : ?>
<?php wp_pagenavi('<div id="wp-pagenavi-wrapper">', '<div id="wp-pagenavi-left"></div><div id="wp-pagenavi-right"></div></div><!-- /wp-pagenavi-wrapper -->') ?>
<?php else: ?>
<div class="navigation clearfix">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
</div>
<?php endif ?>
<?php else: ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php endif ?>