Hi, I need your help in creating a search filter similar to one shown on this site in wordpress. Here is the site. You'll see the filtering options when you hover over the 'calories and diet' located right below the search bar. I have also included a screenshot here. If anyone can help me with this, I would appreciate it.
Hi nhed, You can do this with a $_GET. You can change the url on the submit button with Javascript for each marked category. For example, if I mark "Balanced" and "Low-Fat" and search for food, my url would be edamam.com/?s=food&category=12,23. Then you could retrieve the different category ID's by Array Exploding. $cats = explode(",", $_GET['category']); PHP: Then use a foreach within your mysql query. Hope this helps you out, Kind regards, Maarten
Thank you for your help. After more digging, I am thinking of trying 'custom post types and taxonomies' and use advanced query filters. Do you think I am moving in the right direction?
Hmmm... Well what I would do is write a custom query. If the (isset($_GET['category'])) is true, then I would change my query. But their might be a already baked plugin for you ready in the Wordpress Plugin Directory kitchen. Here, maybe this will help you: http://wordpress.org/plugins/multiple-category-selection-widget/ Hope this helps you out, Kind regards, Maarten