Bold first post title in category
-
Hi there
In my single.php sidebar I’m using this code to bold the current menu item displayed as a list of category posts:
<li<?php if ( $post->ID == $wp_query->post->ID ) { echo ' class="current"'; } else {} ?>>
Works fine. Question is on my category.php page when I list my posts to use as a menu:
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <li<?php if ( $post->ID == $wp_query->post->ID ) { echo ' class="current"'; } else {} ?>> <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> <?php endwhile; ?>
How do I bold up the first title? ie. to denote you’ve landed on the latest post in that cat. Currently they all print as bold. I’m guessing a counter of some sort?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Bold first post title in category’ is closed to new replies.