Count posts in a category

<?php
function wt_get_category_count($input = '') {
global $wpdb;
if($input == '')
{
$category = get_the_category();
return $category[0]->category_count;
}
elseif(is_numeric($input))
{
$SQL = "SELECT $wpdb->term_taxonomy.count FROM $wpdb->terms, $wpdb->term_taxonomy WHERE $wpdb->terms.term_id=$wpdb->term_taxonomy.term_id AND $wpdb->term_taxonomy.term_id=$input";
return $wpdb->get_var($SQL);
}
else
{
$SQL = "SELECT $wpdb->term_taxonomy.count FROM $wpdb->terms, $wpdb->term_taxonomy WHERE $wpdb->terms.term_id=$wpdb->term_taxonomy.term_id AND $wpdb->terms.slug='$input'";
return $wpdb->get_var($SQL);
}
}
?>

<!-- Get current category -->
<?php echo wt_get_category_count(); ?>
<!-- Get category 1 -->
<?php echo wt_get_category_count(1); ?>
<!-- Get category 'hello-world' -->
<?php echo wt_get_category_count('hello-world'); ?>

Gravity Forms taxonomy fix

<?php
//Tag to Taxonomy - A fix for gravity forms

function hyp_tag_to_taxonomy( $form ){
$id = $form['post_id'];
$raw_tag_list = $form['12'];
$tag_array = explode(',', $raw_tag_list);

foreach ($tag_array as $tag){
wp_set_object_terms( $id, $tag, 'collective',true);
}
}

add_action( 'gform_post_submission', 'hyp_tag_to_taxonomy' );

?>

Register custom taxonomy

<?php
add_action( 'init', 'create_my_taxonomies', 0 );

function create_my_taxonomies() {

register_taxonomy( 'my_new_taxonomy1', 'post', array( 'hierarchical' => false, 'label' => 'My New Taxonomy1', 'query_var' => true, 'rewrite' => true ) );

register_taxonomy( 'my_new_taxonomy2', 'post', array( 'hierarchical' => false, 'label' => 'my_new_taxonomy2', 'query_var' => true, 'rewrite' => true ) );

}

?>

<!-- For your post to display tag cloud for your new taxonomy -->

<?php wp_tag_cloud( array( 'taxonomy' => 'my_new_taxonomy1', 'number' => 45 ) ); ?>

<!-- /End -->

<!-- Display taxonomy terms for each post -->

<?php echo get_the_term_list( $post->ID, 'my_new_taxonomy1', 'My New Taxonomy1: ', ', ', '' ); ?>

<!-- /End -->

<!-- Show posts from a certain taxonomy -->

<?php query_posts( array( 'people' => 'will-smith', 'showposts' => 10 ) ); ?>