How do I allow users to sort posts?

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…

Read More
<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?

Related posts

Leave a Reply

1 comment