protected function set_selected_terms() { $this->selected_terms = explode(',', qmt_get_query($this->taxonomy)); }
<?php Starkers_Utilities::get_template_parts( array( 'parts/shared/html-header', 'parts/shared/header' ) ); ?> <main role="main" class="module module__two-cols"> <div class="wrap"> <div class="primary-col"> <div class="page-module-header pad-horiz"> <?php if (is_multitax()) { foreach ( qmt_get_query() as $tax => $slug ) { $terms[] = get_term_by( 'slug', $slug, $tax )->name; } ?> <h1 class="pagetitle"><?php echo implode( ": ", $terms ); ?></h1> <?php } ?> <?php if (!is_multitax()) { foreach ( qmt_get_query() as $tax => $slug ) { $terms[] = get_term_by( 'slug', $slug, $tax )->name; } ?> <h1><?php echo single_cat_title(); ?></h1> <?php } ?> <div class="supplement"> <p class="secondary"> <?php printf( __( '%d %s' ), $wp_query->found_posts, _n( 'job opening', 'job openings', $wp_query->found_posts), get_search_query() ); ?> </p> </div> </div> <div class="jobs-list"> <?php if ( have_posts() ): ?> <?php $posts = query_posts($query_string .'&orderby=title&order=asc&posts_per_page=-1'); ?>
public function get_title() { $title = array(); foreach (qmt_get_query() as $tax => $value) { $terms = preg_split('/[+,]+/', $value); $out = array(); foreach ($terms as $slug) { $term_obj = get_term_by('slug', $slug, $tax); if ($term_obj) { $out[] = $term_obj->name; } } $tax_obj = get_taxonomy($tax); if (count($out) == 1) { $key = $tax_obj->labels->singular_name; } else { $key = $tax_obj->labels->name; } $title[] .= $key . ': ' . implode(' + ', $out); } return implode('; ', $title); }
private function generate_lists($taxonomies, $data) { $query = qmt_get_query(); foreach ($taxonomies as $taxonomy) { $terms = $this->get_terms($taxonomy); if (empty($terms)) { continue; } $walker = new QMT_List_Walker($taxonomy, 'list'); $data_tax = array('taxonomy' => $taxonomy, 'title' => get_taxonomy($taxonomy)->label, 'term-list' => $walker->walk($terms, 0), 'any-text' => __('any', 'query-multiple-taxonomies')); if (isset($query[$taxonomy])) { $data_tax['clear'] = array('url' => QMT_URL::for_tax($taxonomy, ''), 'title' => __('Remove selected terms in group', 'query-multiple-taxonomies')); } $data['taxonomy'][] = $data_tax; } return self::mustache_render('lists.html', $data); }