Output from my theme_links($secondary_links, array('class' => 'links secondary-links')) function looks like this:
<div id="secondary"><ul class="links secondary-links"><li class="first menu-2-1-74"><a href="/taxonomy/term/5" class="menu-2-1-74 active">View Submitted News</a></li>
<li class="last menu-2-2-74"><a href="/node/add/news" class="menu-2-2-74">Add News</a></li>
</ul></div>
The A tags have the "active" class when applicable, but I'd like the LI tags to have that class as well so that I can style with CSS. I've tried a custom function, which seems like it should work, but isn't. Where is the "active" class coming from for the A tags, and how do I get it in the LI tags also? Thanks!!
function kevin_theme_links($links, $attributes = array('class' => 'links')) {
$output = '';
if (count($links) > 0) {
$output = '
';
$num_links = count($links);
$i = 1;
foreach ($links as $key => $link) {
$class = '';
//MY CHANGES:
//Search for 'active' in $key and append to $class for LI.
if (strpos($key, '-active') !== FALSE) {
$class = 'active ';
}
// END MY CHANGES
// Automatically add a class to each link and also to each LI
if (isset($link['attributes']) && isset($link['attributes']['class'])) {