The easiest way to add the nav manu in the dashboard is by using “register_nav_menus()” function and hook in the functions.php
The syntax is as follow:
function menu_name(){
“header” => “primary Menu”,
“footer” => “Footer Menu”
}add_action(“init”,”menu_name”);
// in the above header and footer are the two menus that I am going to embade in my project. You can give other name and you can create as many menus as you want
After this process you have to hook the function by using add_action. You must use ‘init’ and ‘menu_name’ is the the of the function
SHOW MENU IN FRONTEND
if(has_nav_menu(“header){wp_nav_menu(array(
‘menu_class’ => ‘ ‘,
‘menu_id’ => ”,‘container_class’ => ‘ ‘,
‘container_id’ => ‘ ‘,‘before’ => ”,
‘after’ => ”,‘link_before’ => ”,
‘link_after’ => ”
));
}
?>
here ‘menu_class’ and ‘menu_id’ is class and class and id for ul respectively. ‘container_class’ and ‘container_id’ is the class and id for the div respectively.
After 20 years of transforming global communication, Skype has officially ceased operations. Microsoft, which purchased…
In a serene forest by the edge of a sparkling lake, there lived a cheerful…
Retiring comfortably is a goal many aspire to achieve, and with the right strategies, it’s…
Is your computer running frustratingly slow? Don't worry; you're not alone in facing this common…
Once, in a sunny forest, Fox and Crow were friends. One day, Crow found a…