I would appreciate if someone could help me out with the following issue. Here is the thing. I created two select boxes so I could filter and display posts from a custom post type based on two values - custom taxonomy and custom meta value. Here is the code that unfortunately won't render my posts.
<?php $area = $_GET['area']; $menu = $_GET['menu']; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'restaurants', 'posts_per_page' => 10, 'paged' => $paged, 'tax_query' => array( array( 'taxonomy' => 'zones', 'field' => 'slug', 'terms' => explode(',', $area) ) ), 'meta_query' => array( array( 'key' => 'zones', 'value' => $menu ) ) ); $the_query = new WP_Query( $args ); ?>
I am developing a food online ordering system based on WordPress. My search form has two select boxes - Where do you live? and What do you want to eat?
So when a user selects Where do you live? value, the form should filter posts based on that value (i.e. custom taxonomy). Users of my site can also select a value from the other select box What do you want to eat? and the form should be able to update posts based on that as well.
Any hint or help would be greatly appreciated. Thanks a bunch!