Highlighting current post title in get_posts list
-
Hello.
In my sidebar, on my single template, I’m listing all posts under a given category. Code:
<ul> <?php global $post; $myposts = get_posts('showposts=30&category=175'); foreach($myposts as $post) : ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul>
Does anyone have an idea of how to make the current post title highlighted using the style (‘current-post-item’/’current-page-item’ etc) allocated to it?
I’ve been looking at using something similar to
<li<?php if (is_home()) { echo " class=\"current_page_item\""; } ?>>
But I can’t find an ‘is_ ‘ function for the current post title.
Any help much appreciated!
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Highlighting current post title in get_posts list’ is closed to new replies.