WordPress.org

Support

Support » Themes and Templates » Sorting posts on category page – I need a little extra code

Sorting posts on category page – I need a little extra code

  • 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(); ?>
    <div class=”post”>

    <h2 class=”post-title”>“> <?php the_title(); ?> </h2>

    <div class=”post-content”>
    <?php the_excerpt(); ?>
    </div>
    </div>

    <?php endforeach; ?>

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sorting posts on category page – I need a little extra code’ is closed to new replies.