• richarduk

    (@richarduk)


    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)
  • Thread Starter richarduk

    (@richarduk)

    Damn!

    Forgot about the link going active.

    Try this.

    <?php foreach ($posts as $post) : start_wp(); ?>
    <div class=”post”>

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

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

    <?php endforeach; ?>

    Thread Starter richarduk

    (@richarduk)

    Anyone?

    moshu

    (@moshu)

    1. When posting code, please read the instructions below the input area.
    2. That seems to be a WP 1.2 Loop.
    3. Search results for “sort posts alphabetically”:
    http://wordpress.org/search/sort+posts+alphabetically?forums=1

    Thread Starter richarduk

    (@richarduk)

    Sorry! 🙂

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.