Missunderstanding of WordPress menus

I guess you mean the wp_page_menu fallback, where you can use the filters wp_page_menu_args and wp_page_menu to modify it’s output. Notice that this function is a wrapper for the wp_list_pages() function, that ships with the wp_list_pages_excludes and the wp_list_pages filters. That function is again wrapper for the walk_page_tree() function, that activates the Walker_Page class walker … Read more

How can I use archive-{post_type}.php theme template?

Custom post type archive page does not need “dumb” Page. In fact, there could be the culprit. You should try this: Remove /* Template Name: Staff */ from archive-staff_member.php (not needed) Remove “dumb” stuff Page (if created). There could be some permalink conflict. Go to Admin > Settings > Permalinks and re-save it (it will … Read more

Use dashicons in menu items?

the dashicon will only available to you on admin menu images. if you want it on your menu item then you must followed option B. means using awesome font library. for this you need to add it from this : http://fortawesome.github.io/Font-Awesome/ i hope this will helps.

How do I hook into the container of wp_nav_menu?

Solved it by setting container to false and then wrapping it manually. <nav class=”main_navigation”> <div class=”topper”> <a href=”https://wordpress.stackexchange.com/questions/203496/<?=get_home_url()?>” class=”intranet”>H</a> </div> <?php wp_nav_menu(array(‘container’=>false) ?> </nav>

Parsing Menu Items and Blog Posts

I’m sure what you’re asking can be done, but there’s a far simpler, significantly easier solution, just register each menu multiple times for each language, and show different menus for different languages. This way you don’t need to figure out how to filter out menu items depending on GET variables, and your pages become more … Read more

How to exclude pages in the menu without pageID?

Exclusion has to be based on something connected to the pages that is stored in the database. The only thing template-related stored in the database is the filename of your Parallax template, which is stored in post meta under the key _wp_page_template. You could query for pages that either don’t have the key _wp_page_template, or … Read more

Add data-id attribute to child page links

Assuming that your html is outputted by a wordpress menu sitting in a sidebar, you have to extend the Walker_Nav_Menu Class which is used by menu template functions like wp_nav_menu. As stated in the reference of wp_nav_menu, you could modify its output like: class My_DataId_Walker_Nav_Menu extends Walker_Nav_Menu { // other code found in original Walker_Nav_Menu … Read more

Hide menu from homepage

You should be able to short circuit the menu by conditionally returning an empty string by adding this code to your theme functions.php : add_filter( ‘pre_wp_nav_menu’, ‘wpse_210095’); function wpse_210095($menu) { if (is_home()) { $menu = ”; } return $menu; } You can see in the Core where this logic executes: 260 $nav_menu = apply_filters( ‘pre_wp_nav_menu’, … Read more

New walker for walker_nav_menu to change inside container data

Well, you wouldn’t need a walker for that, if it’s simply adding a data attribute or something like that you could just use the items_wrap parameter. View wp_nav_menu() in Resources: $items_wrap = ‘<div class=”top-nav” mine=”something”>’; $items_wrap .= ‘<ul id=”%1$s” mine=”something2″ class=”nav %2$s”>%3$s</ul>’; $items_wrap .= ‘</div>’; wp_nav_menu( array( ‘container’ => false, ‘echo’ => true, ‘before’ => … Read more