Search all taxonomies with wp query
-
When I select all no search results appear, just my standard “sorry nothing found” message.
<?php $club_query = "SELECT wpfr_terms.name, wpfr_terms.term_id as id, wpfr_term_taxonomy.parent FROM wpfr_terms INNER JOIN wpfr_term_taxonomy on wpfr_terms.term_id = wpfr_term_taxonomy.term_id WHERE wpfr_term_taxonomy.taxonomy = 'clubtypes' AND wpfr_term_taxonomy.parent = 0 ORDER BY wpfr_terms.term_id ASC"; $clubtypes = $wpdb->get_results($club_query);?> <label> <span>Club Type</span><br /> <select id="clubtypes-select" class="widefat" name="clubtypes"> <option value="">All</option> <?php foreach($clubtypes as $club) : ?> <option value="<?php echo $club->id; ?>" <?php echo $_GET['clubtypes'] == $club->id ? 'selected="selected"' : '' ; ?> > <?php echo ucwords($club->name); ?> </option> <?php endforeach; ?> </select> </label>
Is there a way to search ALL.
Here is what my search looks like in the address bar
distance=1000&clubtypes=&query_type=club
- The topic ‘Search all taxonomies with wp query’ is closed to new replies.