Title: shortcode output with $count number,how?thx
Last modified: August 20, 2016

---

# shortcode output with $count number,how?thx

 *  [Yong](https://wordpress.org/support/users/yong/)
 * (@yong)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/shortcode-output-with-count-number/)
 *     ```
       add_shortcode( 'tabgroup', 'jqtools_tab_group' );
       function jqtools_tab_group( $atts, $content ){
       $GLOBALS['tab_count'] = 0;
   
       do_shortcode( $content );
       $count = 0;
       if( is_array( $GLOBALS['tabs'] ) ){
       foreach( $GLOBALS['tabs'] as $tab ){
       $tabs[] = '<li id="tab-'.$count.'">'.$tab['title'].'</li>';
       $panes[] = '<li id="panes-'.$count.'">'.$tab['content'].'</li>';
       }
   
       $count++;
   
       $return = "\n".'<div class="tab"><ul class="tab-hd">'.implode( "\n", $tabs ).'</ul>'."\n".'<ul class="tab-bd">'.implode( "\n", $panes ).'</ul></div>'."\n";
   
       return $return;
       }
       }
       ```
   
 * the out put have $count number ,but it’s not in expectted,
 * the output like number 1 have alot of line ,and number 2 have alot of lines too…
 * i want line one with number 1 ,line two with number two ….
 * Thanks
 * (sorry for sick english.)

The topic ‘shortcode output with $count number,how?thx’ is closed to new replies.

## Tags

 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 0 replies
 * 1 participant
 * Last reply from: [Yong](https://wordpress.org/support/users/yong/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/shortcode-output-with-count-number/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
