Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Filtering Views by Custom Field?

$
0
0

Hey all,

Quick question. The new views setup is great btw, but I'm having a bit of trouble.
I'd like to make one view that displays 6 posts of a custom type, Things To Do. The view setup is pretty straight forward; grid, two column, featured image & title. Done.

Now, I'd like to be able to filter the view output on the page. I have a view group, Link To City, that contains one field: City (slug: city).
It's a required field on the Things To Do post type. The options are cities in the county; Douglas, Bill, etc. (8 in total). It is also a required field for any page with the Template = Landing Page (Douglas is default).

The idea is that the user can easily choose the template landing page, choose a city, let's say Douglas, and the view will display all the Things To Do posts with the city field = Douglas.

But it doesn't work.

A Query Filter of wpcf-city = [wpcf-city] doesn't return anything (I tried making it custom short code).
wpcf-city = city – returns every Things To Do post.
wpcf-city = Douglas – returns all the posts related to douglas, so success in that regard, but I would really like the user to be able to select the city. I could make a view for each city, but multiplied by 3 custom post types (Things to Do, See, Places to Eat) that get a bit silly. I'm already making 3 views, one just like this for each Post Type.

Any help would be greatly appreciated.
Thanks,
~ Dr. Peril.


Viewing all articles
Browse latest Browse all 20145

Trending Articles