Manipulate WordPress Menu on custom template
-
I have a custom template in which i am calling wp_nav_menu function like below.
<?php $defaults = array( 'theme_location' => 'header-menu', 'menu' => '', 'container' => 'nav', 'container_class' => 'main-nav', 'container_id' => '', 'menu_class' => 'nav', 'menu_id' => 'sub-nav', 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'depth' => 0, 'walker' => new Nav_Walker_Nav_Menu() ); wp_nav_menu($defaults);
The output i am receiving is like
<a href="#about" class="nav-link">About</a>
When hoveing over the link i get the following url:
https://localhost/mysite/cart/#about
I want to remove cart/ from this url so that i will get the url
https://localhost/mysite/#about
- The topic ‘Manipulate WordPress Menu on custom template’ is closed to new replies.