Views Exposed Filter Query Strings

PROBLEM
This post is just something I found out that I will need to remember.

With views, when I have an exposed filter, what ends up in the query string matters. I would like a clean look so the URL can be something like ?taxonomy=research . I had set up a view so it does do that but then when I went to set up another one, it used the taxonomy id (i.e. ?taxonomy=345 ). How did it get that way?

SOLUTION
It’s all about how you set up the exposed filter in the view. In your view, in the Settings, next to the exposed filter under FILTER CRITERIA, when you select what specific taxonomy to use, you’ll see an option at the very bottom for Selection type. This could be either Dropdown or Autocomplete.

If you select Dropdown, it will use the taxonomy id in the URL (i.e. ?taxonomy=345 ).

If you select Autocomplete, it will use the taxonomy name in the URL (i.e. ?taxonomy=research ).

Have to remember that. But it would be nice for Views to give you the option.


Deprecated: Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead. in /home/niles38/longlivethemonkey.com/syntaxnotes/wp-includes/functions.php on line 6031

Leave a Reply

Your email address will not be published. Required fields are marked *