Searching...
Wednesday 19 October 2016

The wp nav menu Function in wordPress Theme



Why do we have a basic template set up let's go ahead and look at how to control navigation using the wp now the menu function now that we have some basic templates working for Pages what we want to do is activate a dynamic navigation so that we can begin to get around our site however I noticed that when I try to click this now it's not properly working and that when I inspect element and coming to the console I can see that it's having problems finding Foundation. Jas file this tells me that I should come back into my function stop PHP file and look again at how Lincoln and his foundation. Jas file and I noticed that although it's in the correct place and name is actually Foundation. Men. Jas and that's going through things off so this backtracking of finding a JavaScript error on the phone and using the console today and then tracing it back to the functions. PHP file is something that you may need to do with you notice that your JavaScript is not working properly now that it is working properly when we open up our menu we can see the static menu that's married it's left over from a static template what we want to do now is use the wp knob menu function to set up a menu awp not menu function taking number of parameters that lets you control how the menu was displayed what comes before or after it in terms of Market with a third of rapper containers and things like the depth of it whether it's just displaying 1 level 2 etcetera however in order for this to properly work we have to do a couple things with her feet into the admin area in order to get the menu up and running the first of these things that we have to call the ad and support function and pass it the perimeter of menus the reason is that by default WordPress will not automatically give you menus for your feet we have to come into our functions. PHP file and write out a steam support food menus once we do this and we come back into the admin area you can see that we have the ability to create menus we're going to create a menu called main menu and on it we're going to add a basic pages will rearranging into an portal that works for us and then we'll go ahead and save the menu the next thing we have to do comes inside of our functions. PHP file and what we're going to do is tell WordPress that we have a specific menu setup so what this is doing is where we have a menu on the front end of the site and in our template inside the header. PHP file we're going to tell WordPress now by the function stop PHP file that this exists

0 comments:

Post a Comment