get_results(" SELECT $wpdb->terms.name, $wpdb->terms.term_id FROM $wpdb->terms, $wpdb->term_taxonomy WHERE $wpdb->terms.term_id = $wpdb->term_taxonomy.term_id AND $wpdb->term_taxonomy.taxonomy = 'category' {$hide_check} "); if ( empty($last_posts) ) return NULL; $used_cats = array(); $i = 0; foreach ($last_posts as $posts) { if ( in_array($posts->name, $used_cats) ) { unset($last_posts[$i]); } else { $used_cats[] = $posts->name; } $i++; } $last_posts = array_values($last_posts); //$the_output .= ''; echo $the_output; } ?>