Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $taxonomy = 'jobs_category';
- $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>
- <?php wp_list_categories( $args ); ?>
- </ul>
- <h2><?php _e('Categories:'); ?></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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement