0

enter image description here

if(is_tax())
                    {
                        $currentTermType = get_query_var( 'taxonomy' );
                        $cat_icon = get_field('logo', $queried_object);
                        $termId= get_queried_object()->term_id;
                         if(is_tax($currentTermType) && $termId==$term->term_id)
                          $carrentActiveClass='class="active-cat"';
                          $i=0;

                    }    
                        $icon = get_field('logo', $term->taxonomy . '_' . $term->term_id); 
                        $va_category_HTML .= '<li class="logolar" '.$carrentActiveClass.'>' .'<a class="rownum">' .$i++. '</a>'. '</a>';
                        $va_category_HTML .= sprintf('<img src="%s" />', $icon) . '</a>';
                        $va_category_HTML .='<a href="' . esc_url( $term_link ) . '">' . $term->name . '</a>';
                        if (empty( $instance['wcw_hide_count'] )) {
                        $va_category_HTML .='<span class="post-count">'.$term->count.'</span>';
                        }

                        $va_category_HTML .='</li>';
                    }

this is my code

  • And what is your question? – kero Jun 6 at 12:02
  • i want numbering start from first line.. – Ramin Mahmudov Jun 6 at 12:09
1

What if you started your index at 1, instead of 0?

Change: $i=0; To: $i=1;

You might have checked, but you aren't having an CSS / layout issues, are you?

  • problem was that i had wrote $i=0; code inside of if condition and thats way my code did not work.. i locate this code out of if condition and it worked – Ramin Mahmudov Jun 7 at 6:40
  • Glad you figured it out! – ChristopherJones Jun 7 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.