I have a list being generated with a loop like :
<?php $the_query = new WP_Query('cat=40&showposts=10');
while ($the_query->have_posts()) : $the_query->the_post();?>
<?php
$my_post = get_post($post_id);
$title = $my_post->post_title;
$count = 0;
$count ++;
echo '<li class="name-'.$count.'">';
echo '<li>' .$title.'</li>';
?>
Can someone help me have an integer be attached as a class name.. so the output would be something like :
<li class="name-1">title</li>
<li class="name-2">title</li>
My code above just returns :
<li class="name-1">title</li>
<li class="name-1">title</li>