This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Customize Display number of posts

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Customize Display number of posts Reply To: Customize Display number of posts

#41846
Ernest MarcinkoErnest Marcinko
Keymaster

No need to turn on the description if you only want the count as on the screenshot. There is probably an error in the code above, can you please try this variation instead:

add_filter('asp_results', 'asp_change_term_count');
function asp_change_term_count($results) {
    foreach($results as $k=>&$r){
        if ( isset($r->taxonomy) ) {
			$term = get_term_by('id', $r->id, $r->taxonomy);
			if ( $term->count > 1 ) {
				$r->content = $term->count ." Gustscheine";
			} else {
				$r->content = "Ein Gustscheine";
			}
		}
    }
    return $results;
}