• Resolved nikolaj1976

    (@nikolaj1976)


    Hi

    I have created a wordpress site with no menu location set so all pages are shown on the page. When new pages and subpages are created the pages are automatically shown. This is the behaviour I need.

    But I also need to customize the menu like adding extra items and changing links and so but add_filter( ‘wp_nav_menu_items’, ‘dynamic_label_change’, 10, 2 ); only works when I have set a menu as the primary menu.

    Is it possible to customize the menu when there is actually no menu set?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The fallback menu is wp_page_menu which does have a few filters, but not many.
    It would be easier to just create a menu with all the pages on it and tick the box to add new pages when created. Then you can add your other links and make changes once instead of every time the page is loaded.

    Thread Starter nikolaj1976

    (@nikolaj1976)

    Hi Joy

    Thanks for your reply.
    The challenge about what you suggest is that I want the menu to update when new pages are added.
    My solution that works for now is to create an empty menu called Dynamic that I change by getting all pages and then building the menu.

    But thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customizing dynamic menu using filter’ is closed to new replies.