Title: setting sortby
Last modified: August 18, 2016

---

# setting sortby

 *  [dmclark](https://wordpress.org/support/users/dmclark/)
 * (@dmclark)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/setting-sortby/)
 * Hi,
 * I thought I understood filters, but I guess not.
 * I’m trying to have all listings (other than home page)Â display in alphabetical
   ordero.
 * I have:
 * function order_query($query_vars) {
    if (!is_home()) {$query_vars[‘orderby’] 
   = ‘title’;} return $query_vars; }
 * add_filter(‘query_vars’, ‘order_query’);
 * no luck.
 * any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Ryan Boren](https://wordpress.org/support/users/ryan/)
 * (@ryan)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/setting-sortby/#post-123644)
 * You need to use query_string not query_vars.
 * `function order_query($query_string) {
    if (!is_home()) { $query_string = add_query_arg('
   orderby', 'title', $query_string); } return $query_string; }
 * add_filter('query_string', 'order_query');
 *  Thread Starter [dmclark](https://wordpress.org/support/users/dmclark/)
 * (@dmclark)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/setting-sortby/#post-123854)
 * Ah, ok, this helps a tad.
 * My problem now is that these are appended on to $wp_query in a weir way, and 
   I end up with something like
 *  cat=22&full=1?orderby=tittle&order=asc&posts_per_page=10000

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘setting sortby’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [dmclark](https://wordpress.org/support/users/dmclark/)
 * Last activity: [21 years, 5 months ago](https://wordpress.org/support/topic/setting-sortby/#post-123854)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
