• I have a taxonomy list which links to display the children of the selected taxonomy item:

    <?php
    //list terms in a given taxonomy (useful as a widget for twentyten)
    $taxonomy = 'staff-area';
    $tax_terms = get_terms($taxonomy);
    ?>
    
    <div class="staffgroups">
    <ul>
    <?php
    foreach ($tax_terms as $tax_term) {
    echo '<li>' . '<a href="' . esc_attr(get_term_link($tax_term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ), $tax_term->name ) . '" ' . '>' . $tax_term->name.'</a></li>';
    }
    ?>
    </ul>
    
    </div>

    What I would like to do is have the menu item in bold and a different color so that you know which item you are viewing.
    I have tried: .staffgroups ul li a:active but this doesn’t work.
    Any help please?!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The :active selector won’t work here because it refers to the active state i.e. the state when the link is being clicked. You will have to get the id of the term currently being viewed, match that id with the term id in your script and add a particular class if a match occurs.

    Thread Starter Fi Fi P

    (@fi-fi-p)

    Thanks for getting back to me, the problem I have is I want the active item being viewed to stand out in the title list and if I specify by ID it won’t work if the client adds more taxonomy options.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Edit CSS for active links, taxonomy Menu’ is closed to new replies.