wp_nav_menu custom Page class
What you could do is add a custom field to the page, let say we name it “custom_class”. Then you echo it to HTML class. class=”menu-item <?=get_post_meta( get_the_ID(), ‘custom_class’, true );?>”
What you could do is add a custom field to the page, let say we name it “custom_class”. Then you echo it to HTML class. class=”menu-item <?=get_post_meta( get_the_ID(), ‘custom_class’, true );?>”
theme-location should be theme_location Check documentation wp_nav_menu corrected code wp_nav_menu( array( ‘container’ => ‘ul’, ‘menu_class’ => ‘mainNav’, ‘theme_location’ => ‘Pages’ ) ); wp_nav_menu( array( ‘theme_location’ => ‘Categories’ ) );
This is what you have to do: Change the <a href=”#section”></a> to <a href=”http://127.0.0.1/#section”></a> From what i understand home is http://127.0.0.1 and on home #section is located not on http://127.0.0.1/second-page so from http://127.0.0.1/second-page you have to go back to http://127.0.0.1 that goes straight to #section that is located on http://127.0.0.1 That should do the trick
The shop link in your menu gets the “current_page_parent” class when your on a product page. If you have any WooCommerce categories in your menu, they will get “current-product-parent” as a class when you’re on e product page from that category. Simply give those classes the same styling as your active class.
I’ve found a solution to my problem by going over the documentation again and again, looking through source files and just generally running the same section of code over and over to scrutinize the output. This is the solution I came up with, which works just perfectly for my needs: // Get a list of … Read more
How to Use Default Auto-Generated Menu?
To store user–specific information WordPress has a user meta, pretty much identical to post meta (also known as custom fields). See get_user_meta() and related functions. Unfortunately WP doesn’t provide any interface or interface helpers for it. You would have to implement that yourself, probably hooking into user profile screen.
If you want to build your own custom nav menu you should be extending the Walker_Nav_Menu class, not the Walker class. When building a custom menu walker the $db_fields should be what the default Walker_Nav_Menu class has: $db_fields = array (‘parent’ => ‘menu_item_parent’, ‘id’ => ‘db_id’); When building the navigation link for a menu item, … Read more
I think this is likely due to the issue of the core upgrade to jQuery 1.12. Check out this page. In the core discussion yesterday it was the highest priority and decided that it relies on the theme developers, and the users to update. Please take a look at that link, it is extremely helpful. … Read more
Register the navigation menu location in your theme’s functions.php file using the register_nav_menu() function, assign your custom menu to the location in Dashboard > Appearance > Menus, then use the wp_nav_menu() function in your theme’s template files to print the menu’s markup where appropriate. Refer to the overview of Navigation Menus in the Codex.