Forums

wp_list_categories and accordion (2 posts)

  1. dadeeee
    Member
    Posted 2 years ago #

    hi there,

    i came up with a problem: i have to implement an accordion menu and i need to add a class to the "a" tag inside the parent "li" when a "li" has children, in order to call that class with jquery to head the accordion.

    here's the live example: http:/magazine.vedrete.it
    i'm talking about the left menu, without a class for the "a" tag the accordion won't work properly.

    any idea better than working directly on the classes.php insides includes?

    thanks & cheers

    davide

  2. alieneila
    Member
    Posted 2 years ago #

    You'd have to add to the args so that it drills down properly, but for example...

    $categories =  get_categories('hide_empty=0');
    foreach ($categories as $cat) {
    	echo '<a href="?cat=' . $cat->term_id . '" class="myClass">' . $cat->cat_name . '</a>;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic