Forum Replies Created

  • I had to do a bit more searching but your suggestion sent me in the right direction, so thanks @elliot

    Here was my final code:

    	global $post;
    	$the_post_ID = $post->ID;
    <?php foreach ( $posts as $post ) : ?>					
    	<li<?php if ( $post->ID == $the_post_ID ) echo ' class="current"'; ?>>
    	    <h3><a href="<?php the_permalink(); ?>" title="<?php echo get_the_title( $post->ID ); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    <?php endforeach; ?>
  • @elliot

    Thanks for such a quick reply. Looks like we’re close (as in, everything technically works), but when using your code exactly, the active class is being applied to all li.

    Suggestions for adjustments?

Viewing 2 posts - 1 through 2 (of 2 total)