Adding class to current post in sidebar
-
In my single custom_post_type template I have the post displayed on the left and on the right a list of all other posts from that custom_post_type.
I want to dynamically add a class to the list item of the current post so I can style it differently.
Basically I want:
<ul> [if is the current post] <li class="current"><?php the_title(); ?></li> [else] <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> </ul>
I hope this is easy enough to understand?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Adding class to current post in sidebar’ is closed to new replies.