• Resolved utnalove

    (@utnalove)


    Hello, I created a menu using this code:
    https://github.com/tokmak/wp-select-menu

    It works fine, but there are two thinks I want to change:
    1) in the generated URLs it shows the post id, instead of the page slug. I want it to show the page url, instead than /?234

    2) If I put the second code wp_nav_menu( array(... in the middle of the header (or at the end, wherever), it brings the menu to the very top straight after the <body> opening tag. How do I change that to have the menu in the right place I want it to be in the header or footer?

    Thanks

    • This topic was modified 4 years, 9 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    wp_nav_menu() should reflect URLs as specified in your permalinks settings. Except for the custom link menu item which of course is whatever you enter as an URL. If that is not so, your theme or a plugin is altering normal behavior.

    Where ever you place a call to wp_nav_menu() in a template should be where the menu HTML is output relative to other template output. This is not necessarily where the menu visually appears on a page. Elements can be moved around by script or CSS. Once again, if you experience anything different, your theme or a plugin is altering normal behavior.

    Without a link to your site demonstrating the problem, that’s about all I can say on the subject. If you are experiencing unexpected behavior, I suggest asking through your theme’s dedicated support channel where the theme devs and expert users can better help you.

    Thread Starter utnalove

    (@utnalove)

    Thank you for the good and kind explanation.
    I firstly tested on the staging site. And I noticed that was the reason for the URLs with IDs instead than seo friendly urls.

    So problem 1 resolved.

    Problem 2 also resolved. I had to put the code not in the header.php but in a wrapper-header.php

    Thanks again, it helped me to investigate the problem further

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to fix mobile menu function – need to stick it and change id to page name’ is closed to new replies.