How to display menu item description on rollover
-
Hi, i’m trying to create an effect with custom menus on WordPress 3.0 I was able to do before on a previous site.
I have a widget area on header.php which will have a custom menu.
When the user passes the mouse on a menu item, i want the item description (that appears in the “title” attribute of the link) to be displayed as a span element, properly stiled.
I achieved this effect once, but with a category menu, the code follows:
<ul id="descrollover"><?php $categories = get_categories('number=10'); foreach ($categories as $cat)
{echo "<li class=\"cat-item\">term_id ) . "\">" . $cat->cat_name . "<span>". $cat->description ."</span>";
} ?>all I needed was to style that
<span>
element and it showed up nicely where I wanted.How to do this with custom menus then?
Thanks a lot!
- The topic ‘How to display menu item description on rollover’ is closed to new replies.