WordPress.org

Forums

[resolved] Custom menu - Child menus (6 posts)

  1. _blackened_
    Member
    Posted 3 years ago #

    I have a custom menu in a wordpress website.

    To display the menu I use

    <?php wp_nav_menu( array('menu' => 'side_nav' )); ?>

    And the CSS looks like this:

    [CSS moderated as per the Forum Rules. Please just post a link to your site.]

    OK, looks good.

    Link 1
    SubLink1
    SubLink2
    Link 2
    SubLink3
    SubLink4

    (You get it)

    What I want to do is so when the parent (Link1/Link2) is CLICKED (not hovered) but clicked, so the "parent" link is active, only then will the sublinks to THAT "parent" show.

    How do I do this?

    eg.

    Link 1 (active/clicked/on that page)
    SubLink1
    Sublink2
    Link 2
    Link 3

  2. _blackened_
    Member
    Posted 3 years ago #

    BTW, this pretty urgent. It's for a client and deadline is tomorrow.

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-vertical-accordion-menu-widget/

    Is the first thing I came across for reference. Not what you are looking for I believe, but trying to pinpoint the terminology. I searched for 'jquery vertical accordion menu click'

    It's going to have to be a jquery solution, there may be plugins.... or it may be code

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    Actually, that plugin may work rather well..... it seems to support your custom menus.....

  5. remix4
    Member
    Posted 3 years ago #

    Rev. Voodoo - thanks for the mention!

    Correct that the accordion menu plugin should be able to handle the job

  6. _blackened_
    Member
    Posted 3 years ago #

    Solved it by writing a short Javascript :)

Topic Closed

This topic has been closed to new replies.

About this Topic