title: Remove post count from Wordpress custom widget
body: <p>I'm a noob running a project theme Wordpress website. There is a widget that shows a "Browse by Category" list in columns.</p>
  
  <p>The widget shows the post count in brackets next to the category heading. I want to remove that.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>This is the code for the widget:</p>
  
  <pre><code>    add_action('widgets_init', 'register_browse_by_category_widget');
      function register_browse_by_category_widget() {
      register_widget('ProjectTheme_browse_by_category');
  }
  
  class ProjectTheme_browse_by_category extends WP_Widget {
  
      function ProjectTheme_browse_by_category() {
          $widget_ops = array( 'classname' =&gt; 'browse-by-category', 'description' =&gt; 'Show all categories and browse by category' );
          $control_ops = array( 'width' =&gt; 200, 'height' =&gt; 250, 'id_base' =&gt; 'browse-by-category' );
          $this-&gt;WP_Widget( 'browse-by-category', 'ProjectTheme - Browse by Category', $widget_ops, $control_ops );
      }
  
      function widget($args, $instance) {
          extract($args);
  
          echo $before_widget;
  
          if ($instance['title']) echo $before_title . apply_filters('widget_title', $instance['title']) . $after_title;
  
          $loc_per_row    = $instance['loc_per_row'];
          $widget_id      = $args['widget_id'];
          $nr_rows        = $instance['nr_rows'];
          $only_these     = $instance['only_these'];
          $only_parents   = $instance['only_parents'];
  
          if($only_parents == "on") $only_parents = true;
          else $only_parents = false;
  
  
          $nr = 4;
  
          if(!empty($loc_per_row)) $nr = $loc_per_row;
          echo '&lt;style&gt;#'.$widget_id.' #location-stuff li&gt;ul { width: '.(round(100/$nr)-0.5).'%}&lt;/style&gt;';
  
          if($nr_rows &gt; 0) $jk = "&amp;number=".($nr_rows * $loc_per_row);
  
          $terms_k = get_terms("project_cat","parent=0&amp;hide_empty=0");
          $terms = get_terms("project_cat","parent=0&amp;hide_empty=0".$jk);
  
  
          //$term = get_term( $term_id, $taxonomy ); 
  
          if($only_these == "1")
          {
              $terms = array();
  
              foreach($terms_k as $trm)
              {
                  if($instance['term_' . $trm-&gt;term_id] == $trm-&gt;term_id)
                      array_push($terms, $trm);
              }
  
          }
  
  
          //-----------------------------
  
           if(count($terms) &lt; count($terms_k)) $disp_btn = 1;
          else $disp_btn = 0;
  
  
          $count = count($terms); $i = 0;
          if ( $count &gt; 0 ){
               echo "&lt;ul id='location-stuff'&gt;";
               foreach ( $terms as $term ) {
  
                 if($i%$nr == 0) echo "&lt;li&gt;";
                 $total_ads = 0;
                 $terms2 = '';
                  $terms2 = get_terms("project_cat","parent=".$term-&gt;term_id."&amp;hide_empty=0");
  
                  $mese = '';
  
                      $mese .= '&lt;ul&gt;';
                      $mese .= "&lt;img src=\"".get_bloginfo('template_url')."/images/posted.png\" width=\"20\" height=\"20\" /&gt; 
                      &lt;h3&gt;&lt;a class='parent_taxe' rel='taxe_project_cat_".$term-&gt;term_id."' href='".get_term_link($term-&gt;slug,"project_cat")."'&gt;" . $term-&gt;name;
  
                      //."&lt;/a&gt;&lt;/h3&gt;";
  
                 $total_ads = ProjectTheme_get_custom_taxonomy_count('project',$term-&gt;slug);
  
                 $mese2 = '';
                 if($terms2 &amp;&amp; $only_parents == false)
                  {
  
                      foreach ( $terms2 as $term2 ) 
                      {
                          $tt = ProjectTheme_get_custom_taxonomy_count('project',$term2-&gt;slug);
                          $total_ads += $tt;
                          //$mese2 .= "&lt;li&gt;&lt;a href='".get_term_link($term2-&gt;slug,"project_cat")."'&gt;" . $term2-&gt;name." (".$tt.")&lt;/a&gt;&lt;/li&gt;";
                          $mese2 .= "&lt;li&gt;&lt;a href='".get_term_link($term2-&gt;slug,"project_cat")."'&gt;" . $term2-&gt;name." &lt;/a&gt;&lt;/li&gt;";
                      }
                  }
  
                      echo $mese."(".$total_ads.")&lt;/a&gt;&lt;/h3&gt;";
                      echo '&lt;ul id="_project_cat_'.$term-&gt;term_id.'"&gt;'.$mese2."&lt;/ul&gt;";
  
                      echo '&lt;/ul&gt;';
  
  
                 if(($i+1) % $nr == 0) echo "&lt;/li&gt;";
  
                 $i++;
  
               }
  
                  //if(($i+1) % $nr != 0) echo "&lt;/li&gt;";
  
  
               echo "&lt;/ul&gt;";
  
           }           
  
          if($disp_btn == 1)
          {
                  echo '&lt;br/&gt;&lt;b&gt;&lt;a href="'.get_permalink(get_option('ProjectTheme_all_categories_page_id')).'"&gt;'.__('See More Categories','ProjectTheme').'&lt;/a&gt;&lt;/b&gt;';     
          }       
  
  
  
          echo $after_widget;
      }
  
      function update($new_instance, $old_instance) {
  
          return $new_instance;
      }
  
      function form($instance) { ?&gt;
          &lt;p&gt;
              &lt;label for="&lt;?php echo $this-&gt;get_field_id('title'); ?&gt;"&gt;&lt;?php _e('Title'); ?&gt;:&lt;/label&gt;
              &lt;input type="text" id="&lt;?php echo $this-&gt;get_field_id('title'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('title'); ?&gt;" 
              value="&lt;?php echo esc_attr( $instance['title'] ); ?&gt;" style="width:95%;" /&gt;
          &lt;/p&gt;
  
          &lt;p&gt;
              &lt;label for="&lt;?php echo $this-&gt;get_field_id('only_parents'); ?&gt;"&gt;&lt;?php _e('Only show parent categories'); ?&gt;:&lt;/label&gt;
              &lt;input type="checkbox" id="&lt;?php echo $this-&gt;get_field_id('only_parents'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('only_parents'); ?&gt;" 
              &lt;?php echo (esc_attr( $instance['only_parents'] ) == "on" ? "checked='checked'" : ""); ?&gt; /&gt;
          &lt;/p&gt;
  
  
          &lt;p&gt;
              &lt;label for="&lt;?php echo $this-&gt;get_field_id('loc_per_row'); ?&gt;"&gt;&lt;?php _e('Number of Columns'); ?&gt;:&lt;/label&gt;
              &lt;input type="text" id="&lt;?php echo $this-&gt;get_field_id('loc_per_row'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('loc_per_row'); ?&gt;" 
              value="&lt;?php echo esc_attr( $instance['loc_per_row'] ); ?&gt;" style="width:20%;" /&gt;
          &lt;/p&gt;
  
          &lt;p&gt;
              &lt;label for="&lt;?php echo $this-&gt;get_field_id('nr_rows'); ?&gt;"&gt;&lt;?php _e('Number of Rows'); ?&gt;:&lt;/label&gt;
              &lt;input type="text" id="&lt;?php echo $this-&gt;get_field_id('nr_rows'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('nr_rows'); ?&gt;" 
              value="&lt;?php echo esc_attr( $instance['nr_rows'] ); ?&gt;" style="width:20%;" /&gt;
          &lt;/p&gt;
  
  
           &lt;p&gt;
              &lt;label for="&lt;?php echo $this-&gt;get_field_id('nr_rows'); ?&gt;"&gt;&lt;?php _e('Only show categories below'); ?&gt;:&lt;/label&gt;
              &lt;?php echo '&lt;input type="checkbox" name="'.$this-&gt;get_field_name('only_these').'"  value="1" '.(
       $instance['only_these'] == "1" ? ' checked="checked" ' : "" ).' /&gt; '; ?&gt;
          &lt;/p&gt;
  
          &lt;p&gt;
              &lt;label for="&lt;?php echo $this-&gt;get_field_id('nr_rows'); ?&gt;"&gt;&lt;?php _e('Categories to show'); ?&gt;:&lt;/label&gt;
  
                  &lt;div style=" width:220px;
      height:180px;
      background-color:#ffffff;
      overflow:auto;border:1px solid #ccc"&gt;
       &lt;?php
  
       $terms = get_terms("project_cat","parent=0&amp;hide_empty=0");
       foreach ( $terms as $term ) {
  
       echo '&lt;input type="checkbox" name="'.$this-&gt;get_field_name('term_'.$term-&gt;term_id).'"  value="'.$term-&gt;term_id.'" '.(
       $instance['term_'.$term-&gt;term_id] == $term-&gt;term_id ? ' checked="checked" ' : "" ).' /&gt; ';
       echo $term-&gt;name.'&lt;br/&gt;';
  
       }
  
       ?&gt;
  
      &lt;/div&gt; 
  
  
  
          &lt;/p&gt;
  
  
      &lt;?php 
      }
  }
  
  ?&gt;
  </code></pre>