Put some html code after third item in the loop
-
Hi, so I got code that displays all post in current category right here:
<ul> <?php foreach((get_the_category($post->ID)) as $category) { ?> <?php $catVal = $category->cat_ID; } $IDOutsideLoop = $post->ID; global $post; $myposts = get_posts('category='.$catVal.'&numberposts=999&order=ASC'); foreach ($myposts as $post) { ?> <li<?php if($IDOutsideLoop == $post->ID) { echo " class=\"current\""; } ?>> <a href="<?php the_permalink() ?>"><?php the_title(); ?></a> <?php }; ?> </ul>All I need is to echo some html code only after 3 item from the loop. I`m not a php guy, so please If You be so kind and give me ready and workind code I will be delighted. Thank You.
Rafał
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘Put some html code after third item in the loop’ is closed to new replies.