• 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.