index.php loop to display category specific posts only
-
Hey everyone,
I apologise for being a novice at this because I can find a lot of relative information about this in the help and on many previous posts but I can’t seem to find/understand a close enough simple solution (i’m a php newbie).
What I’m looking for is a simple customised loop, so when I load my index.php, instead of it loading up the most recent posts, I want it to display exactly the same (full post with title and date) but only posts from a category that I specify.
Simple, static, I don’t think it should be very hard.
This is my loop, very short (taken comments out etc.)
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php the_date('','<h2>','</h2>'); ?> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3> <div class="meta"><?php the_category(',') ?> <?php edit_post_link(__('edit')); ?></div> <div class="storycontent"> <?php the_content(__('(more...)')); ?> </div>
Now what can I add to that to make filter out a category?
If any one could help, I’d be very appreciative as I have spent the last 3 days trying to figure this out.
Cheers
- The topic ‘index.php loop to display category specific posts only’ is closed to new replies.