In my theme there is a function for nav menus
function ct_nav() {
<nav>
<?php wp_nav_menu( array( 'container_id' => 'nav', 'theme_location' => 'primary') ); ?>
</nav>
}
How could i add more item manually? using this function alone.
On the Navigation page, click the title of the menu that you want to edit. Click Add menu item. Enter a name for the menu item. This name displays in the menu, and can include special characters or emoji.
To do this go to Appearance >Menus and start creating a new menu. Give the menu the title “Secondary Menu”, select “My Custom Menu” for a location and then hit the “Create Menu” button. Finally add some items to the menu (for example Menu item 1, Menu item 2, Menu item 3) and then save the menu.
function add_last_nav_item($items) {
return $items .= '<li><a href="#myModal" role="button" data-toggle="modal">Contact</a></li>';
}
add_filter('wp_nav_menu_items','add_last_nav_item');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With