This is my basic loop for a category page where I’m inserting links to each post with an excerpt acting as a description.
What do I need to do to sort the posts alphabetically?
<?php foreach ($posts as $post) : start_wp(); ?>
<h2 class=”post-title”>“> <?php the_title(); ?> </h2>
<?php the_excerpt(); ?>
<?php endforeach; ?>
- The topic ‘Sorting posts on category page – I need a little extra code’ is closed to new replies.