2015-07-30, 00:19:26
(2015-07-27, 18:24:18)GPB61 Wrote: I was wondering if on the sidebar nm_tag_list function, is there a way to ad a class "active" to the tag which is currently used to display the posts? In this way, the tag list could be even used as a navigation bar.
On the reverse nm_list_tag you use a condition to "weight" the tag to change its appearance into the cloud, and I was wondering if the same cannot be done for the list too, but with the condition "if the post/s displayed belong to that speciific tag..."
Thanks a lot as always
Gianpaolo
I'll add support for that.
In the meantime, you can make a copy, in your theme's functions.php file, of function nm_tag_list() (you can find it at news_manager/inc/sidebar.php) with a different name (that you would use in your template) with this change:
Replace
Code:
echo ' <li><a href="',$url,'">',htmlspecialchars($tag),'</a></li>',PHP_EOL;
Code:
echo ' <li',(nm_is_tag($tag) ? ' class="active"' : ''),'><a href="',$url,'">',htmlspecialchars($tag),'</a></li>',PHP_EOL;