How do I allow users to sort posts? [duplicate]

Possible Duplicate:
How do I sort multiples pages?

I want to allow users to sort a long list of posts (that are displayed on multiple pages) by custom fields.

Here is my form…

<form method="post" id="order">
  <select name="sort" onchange="this.form.submit()">
    <option value="">Sort by</option>  
    <option value="zip">Sort by Zip Code</option>
    <option value="type">Sort by Property Type</option>
  </select>
</form>

I was told that I need to use sessions. However, I don’t know how to code this. Could anyone give me an example based on the form above?

1 Answer
1

You can add a query to the URL in WordPress, and then just link to that query, see – http://codex.wordpress.org/Function_Reference/add_query_arg

Leave a Comment