title: Filter posts by custom fields
body: <p>I want to give users the ability to sort posts themselves using some filter links on the side, so for instance:</p>
  
  <p>To sort by title: www.example.com/?orderby=title&amp;order=asc</p>
  
  <p>To sort by date: www.example.com/?orderby=date&amp;order=asc</p>
  
  <p>So I want to be able to sort posts using a custom field called "shares" that returns a number , and I use Advanced Custom Fields plugin to generate that field, but not sure how I can generate such query and more importantly, giving a link to apply it if possible.</p>
  
  <p>thanks in advance.</p>