The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Sort by post_title in category view... (2 posts)

  1. zaphod_beeblebrox
    Posted 10 years ago #

    I simply want to sort all my posts onto one page (about 140 posts in total) and sort by post_title in ASCending order.

    Is there a simple way to do this?

    I've given up completely on sorting by custom fields - it seems that WP was almost *designed* not to do this easily :)

    That said, great system.

  2. Kafkaesqui

    Posted 10 years ago #

    If this is about a specific category of posts (your "all my posts on one page" is a little confusing), here's what I'd do:

    1. Set up a category template for that category.

    2. In your category's template, initialize The Loop using query_posts(), like so:

    <?php query_posts('cat=10&showposts=-1&orderby=title&order=ASC'); ?>

    That queries the category #10, showing all posts (-1 means 'all' in this case) in that category, sorts posts by their title and lists them in ASCending order.

Topic Closed

This topic has been closed to new replies.

About this Topic