add class=”selected” to a mini loop
-
Hello everybody,
i’ve been trying to resolve a problem for quite a long time:if i create a miniloop for, let’s say, titles from last 3 posts from a given coategory i can make a small navigation box to put in my site. what i’m trying to do is to add a css class (for example “selected”) to one of the link if, and only if, i’m currently in the post that the link point to. It should be similar to the navigation menu but transferred to a miniloop. Obiouvsly i cant hard code the 3 links menu and use
<?php if (is_page(‘my_post’)) { echo “class=selected”; }?> because i would have to change that box everytime a new post is added.the concept should be to check the id of the page/post e verify if the id matches the id of the page the link is pointing to.
any hints?
thanks,
molokom
- The topic ‘add class=”selected” to a mini loop’ is closed to new replies.