title: create span after li a in categories in wordpress
body: <p>in my categories widget items displaying below the format in wordpress.</p>
  
  <pre><code>&lt;ul&gt;
     &lt;li class="cat-item cat-item-5"&gt;&lt;a href="#"&gt;Construction&lt;/a&gt;(2)&lt;/li&gt;
     &lt;li class="cat-item cat-item-1"&gt;&lt;a href="#"&gt;uncategorized&lt;/a&gt; (1)&lt;/li&gt;
     &lt;li class="cat-item cat-item-7"&gt;&lt;a href=""&gt;Workers&lt;/a&gt; (1)&lt;/li&gt;
     &lt;li class="cat-item cat-item-9"&gt;&lt;a href=""&gt;Workplace&lt;/a&gt; (1)&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I want to display the categories list in below the format. anyone help me. </p>
  
  <pre><code>&lt;ul&gt;
     &lt;li class="cat-item cat-item-5"&gt;&lt;a href="#"&gt;Construction&lt;/a&gt;(2)&lt;span class="demo"&gt;&lt;/span&gt;&lt;/li&gt;
     &lt;li class="cat-item cat-item-1"&gt;&lt;a href="#"&gt;uncategorized&lt;/a&gt; (1)&lt;span class="demo"&gt;&lt;/span&gt;/li&gt;
     &lt;li class="cat-item cat-item-7"&gt;&lt;a href=""&gt;Workers&lt;/a&gt; (1)&lt;span class="demo"&gt;&lt;/span&gt;&lt;/li&gt;
     &lt;li class="cat-item cat-item-9"&gt;&lt;a href=""&gt;Workplace&lt;/a&gt; (1)&lt;span class="demo"&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>
  
  <p>This my code to generate list items. category.php file in theme file.</p>
  
  <pre><code>function get_the_category_list( $separator = '', $parents='', $post_id = false ) {
  global $wp_rewrite;
  if ( ! is_object_in_taxonomy( get_post_type( $post_id ), 'category' ) ) {
      /** This filter is documented in wp-includes/category-template.php */
      return apply_filters( 'the_category', '', $separator, $parents );
  }
  
  $categories = get_the_category( $post_id );
  if ( empty( $categories ) ) {
      /** This filter is documented in wp-includes/category-template.php */
      return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents );
  }
  
  $rel = ( is_object( $wp_rewrite ) &amp;&amp; $wp_rewrite-&gt;using_permalinks() ) ? 'rel="category tag"' : 'rel="category"';
  
  $thelist = '';
  if ( '' == $separator ) {
      $thelist .= '&lt;ul class="post-categories"&gt;';
      foreach ( $categories as $category ) {
          $thelist .= "\n\t&lt;li&gt;";
          switch ( strtolower( $parents ) ) {
              case 'multiple':
                  if ( $category-&gt;parent )
                      $thelist .= get_category_parents( $category-&gt;parent, true, $separator );
                  $thelist .= '&lt;a href="' . esc_url( get_category_link( $category-&gt;term_id ) ) . '" ' . $rel . '&gt;' . $category-&gt;name.'&lt;/a&gt;&lt;/li&gt;';
                  break;
              case 'single':
                  $thelist .= '&lt;a href="' . esc_url( get_category_link( $category-&gt;term_id ) ) . '"  ' . $rel . '&gt;';
                  if ( $category-&gt;parent )
                      $thelist .= get_category_parents( $category-&gt;parent, false, $separator );
                  $thelist .= $category-&gt;name.'&lt;/a&gt;&lt;/li&gt;';
                  break;
              case '':
              default:
                  $thelist .= '&lt;a href="' . esc_url( get_category_link( $category-&gt;term_id ) ) . '" ' . $rel . '&gt;' . $category-&gt;name.'&lt;/a&gt;&lt;/li&gt;';
          }
      }
      $thelist .= '&lt;/ul&gt;';
  } else {
      $i = 0;
      foreach ( $categories as $category ) {
          if ( 0 &lt; $i )
              $thelist .= $separator;
          switch ( strtolower( $parents ) ) {
              case 'multiple':
                  if ( $category-&gt;parent )
                      $thelist .= get_category_parents( $category-&gt;parent, true, $separator );
                  $thelist .= '&lt;a href="' . esc_url( get_category_link( $category-&gt;term_id ) ) . '" ' . $rel . '&gt;' . $category-&gt;name.'&lt;/a&gt;';
                  break;
              case 'single':
                  $thelist .= '&lt;a href="' . esc_url( get_category_link( $category-&gt;term_id ) ) . '" ' . $rel . '&gt;';
                  if ( $category-&gt;parent )
                      $thelist .= get_category_parents( $category-&gt;parent, false, $separator );
                  $thelist .= "$category-&gt;name&lt;/a&gt;";
                  break;
              case '':
              default:
                  $thelist .= '&lt;a href="' . esc_url( get_category_link( $category-&gt;term_id ) ) . '" ' . $rel . '&gt;' . $category-&gt;name.'&lt;/a&gt;';
          }
          ++$i;
      }
  }
  
  /**
   * Filter the category or list of categories.
   *
   * @since 1.2.0
   *
   * @param array  $thelist   List of categories for the current post.
   * @param string $separator Separator used between the categories.
   * @param string $parents   How to display the category parents. Accepts 'multiple',
   *                          'single', or empty.
   */
  return apply_filters( 'the_category', $thelist, $separator, $parents );
  }
  </code></pre>