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.

If you go to this site: http://www.ec-ohio.com and click on one of the links in the Directory (left column of homepage) you generate a page with listings, and at the top of each page there's 3 links that let you sort the page content by city, county or product.

I want to rebuild the site in WP, but am wondering how to enable that kind of sorting. I was going to enter the listings via custom post types.

Any advice greatly appreciated!

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Could you clarify, I think what your asking is if your able to specify post types when querying - you certainly can.

http://codex.wordpress.org/Class_Reference/WP_Query#Type_.26_Status_Parameters

If you asking about category searches, then yes of course. That same link also has information on querying taxonomy, there are many ways to do that thought that depend on the actual site being built.

Edit: From the comments it seems you need to Orderby metadata.. http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters

share|improve this answer
    
I'm not asking about Category Searches, though, thanks for commenting! I am asking about how to sort entries already on a page. If I have a page of Farmers Markets, listed alphabetically, and I want people to be able to click on a link and SORT those Farmers Markets by City - how do I do that? IOW, I would be reshuffling the entries on the page - not replacing them. They wouldn't be there as a result of a search. They would be there because someone clicked on a link called "Farmers Markets". And I want those entries to be sortable by City, County, and/or Product. Make sense? –  PVA Aug 23 '11 at 18:39
    
I think what you need is this WP_Query Orderby Parameters –  eddiemoya Aug 23 '11 at 21:36
    
I suggest making 'city' metadata. –  eddiemoya Aug 23 '11 at 22:45
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.