Multiple criteria trouble
-
i have script, this is the filter for jobboard. But I can select only job_type and view the results or job_pomer and view the results. Is there a way to display more than one select box, each one for a different taxonomy in order to filter posts by multiple criteria. I
Thank you
<?php $taxonomy = 'job_pomer'; $orderby = 'name'; $show_count = 1; // 1 for yes, 0 for no $pad_counts = 0; // 1 for yes, 0 for no $hierarchical = 1; // 1 for yes, 0 for no $title = ''; $arg = array( 'taxonomy' => $taxonomy, 'orderby' => $orderby, 'show_count' => $show_count, 'hierarchical' => $hierarchical, 'title_li' => $title ); ?> <ul> </ul> <h2><?php _e('Pomer práce:'); ?></h2> <form id="categoriesform1" action="<?php bloginfo('url'); ?>" method="get"> <div> <?php $cats = get_categories($arg); ?> <select id="categories"> <?php foreach ($cats as $fat) : ?> <option value="<?php echo get_term_link($fat, $fat->taxonomy) ?>"><?php echo $fat->name ?></option> <?php endforeach; ?> </select> <input type="submit" name="submit" value="view" /> </div> </form> <script> jQuery(document).ready(function() { jQuery('#categoriesform1').submit(function() { window.location = jQuery('#categories').val(); return false; }); }); </script> <?php $taxonomy = 'job_type'; $orderby = 'name'; $show_count = 1; // 1 for yes, 0 for no $pad_counts = 0; // 1 for yes, 0 for no $hierarchical = 1; // 1 for yes, 0 for no $title = ''; $args = array( 'taxonomy' => $taxonomy, 'orderby' => $orderby, 'show_count' => $show_count, 'hierarchical' => $hierarchical, 'title_li' => $title ); ?> <ul> </ul> <h2><?php _e('Typ práce:'); ?></h2> <form id="categoriesform" action="<?php bloginfo('url'); ?>" method="get"> <div> <?php $cats = get_categories($args); ?> <select id="categories"> <?php foreach ($cats as $cat) : ?> <option value="<?php echo get_term_link($cat, $cat->taxonomy) ?>"><?php echo $cat->name ?></option> <?php endforeach; ?> </select> <input type="submit" name="submit" value="view" /> </div> </form> <script> jQuery(document).ready(function() { jQuery('#categoriesform').submit(function() { window.location = jQuery('#categories').val(); return false; }); }); </script>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Multiple criteria trouble’ is closed to new replies.