Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've just launched a site that has a RESOURCES section in it, listing of school, documents etc. now the client asks to add an 'Alphabetical Sorter' that will enable the users to see in each specific category the post/resources according to their first letter.

This wouldn't be to hard (theoretically), the problems are that those are custom-post-types with nested categories and I already manipulate the request (on the request filter) to get what I want and not a 404.

The structure is domain.com/resources/parent-category/child-category/post-name and I'd like to have pretty permalink look so domain.com/resources/parent-category/child-category/A-Z and not using a index=A-Z.

This should also work (show the correct posts in a-z order) when the user deletes part of the url, i.e. domain.com/resources/parent-category/A-Z or domain.com/resources/A-Z.

What would be the best approach for that, considering we can't go back and add 'category per letter', taxonomy, custom field etc.? Is there a way to maybe hook into the raw SQL and edit it like here http://wordpress.org/support/topic/first-letter-posts?

Thanks!

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

My recommendation would be to use query_posts() to modify your query such that orderby=title and order=ASC ... this will return the same results as your first query, but with the posts ordered alphabetically by title.

share|improve this answer
    
Both are public query vars, the user would only need request them in the query string to the given page. –  t31os Dec 18 '10 at 19:24
    
@EAMann query_posts()? :) –  kaiser Oct 29 '12 at 9:05
add comment

Definitely the Advanced Post Types Order is the best plugin for that purpose, it allow to alphabetize the post for certain categories. Also you can order using a custom field.

share|improve this answer
add comment

This plugin might be helpful: http://www.nateomedia.com/wares/downloads/wordpress/wp-snap/

(WP-SNAP stands for: WordPress System for Navigating Alphabetized Posts)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.