WordPress.org

Ready to get started?Download WordPress

Forums

wp_nav_menu: How to add sub items to parent item with add_filter? (3 posts)

  1. clinton4
    Member
    Posted 1 year ago #

    Hi,

    Let's say have setup the following menu in wordpress.

    Item-1
    -- Subitem-1-1
    -- Subitem-1-2
    Item-2
    Item-3

    How can i add Subitems to Item-2 by using add_filter?

  2. Jose Castaneda
    Member
    Posted 1 year ago #

    As far as I know you can add sub-menu items in the menu screen if the theme supports nav menus - which just about all do. Or are you trying to add a random item? If that is the case one possible way I can think of would be using a custom walker class.

  3. clinton4
    Member
    Posted 1 year ago #

    Hi,

    Yes i know about the option to add sub-menus from menu screen. But i need to inject some dynamic links under Item-2. I have looked at walker class, but could not find a solution to inject submenus.

Topic Closed

This topic has been closed to new replies.

About this Topic