Articles of menus

How to Emulate Default Navigation Menu Behaviour in a Custom Theme?

I’m trying my hand at developing a custom theme, and I’ve got navigation menus working (with the help of this walker, but only if they’re explicitly defined in the menu settings. The default themes (twentyfourteen, twentythirteen) seem to be able to create a default menu solely from the existing pages hierarchy, without needing to create […]

How can I add a class to a nav menu when I'm viewing a child page?

I’m using bootstrap in my theme, so I have a requirement that I add a class of active to the current nav menu item. I was able to achieve this by using the nav_menu_css_class filter add_filter(‘nav_menu_css_class’ , ‘special_nav_class’ , 10 , 2); function special_nav_class($classes, $item){ if( in_array(‘current-menu-item’, $classes) ){ $classes[] = ‘active ‘; } return […]

Dynamic menu wp_list_pages displaying only current branch including: current page, his siblings and its childs

I’m trying to build a sidebar menu displaying child pages of a grandparent page, his siblings and their childs, and keep those siblings and childs available while navigating through them. I’ve been looking at different and similar posts at the forum, but so far I haven’t had any luck with an exact solution or something […]

Get current post's nav menu name (term name)

I want to get the nav menu name by the current post ID. After hours searching in my database I found out that navigation menus are basically just terms of the taxonomy ‘nav_menu’. But for some reason they don’t work the same. I have tried to get the terms (nav menu’s) with the get_the_terms() function, […]

Removing a page from the header menu

My site is using the Hemmingway theme, I have a menu in the header. This is the menu whose structure results from assigning a “parent” on a page’s edit form. One of my pages is less important and should not appear in the menu. (It is accessible through links from the body of other pages.) […]

How to Sync Menu, Widgets and other masters from Main Website to its Sub Site

I am using WordPress Multisite Network and i am having problems regarding masters to its subsite. I am not able to see the widgets or Menus which were created on Main website to its Sub-site. When i am going to check in the Database whole tables are different of every subsite. So is there any […]

How to hide page links from theme menu

I’m working on a plugin, I programatically create some pages in posts table, the links appear in the theme menu(front end), I don’t want some of these page links to appear, how do I do this?

How to add scroll IDs to WordPress menu anchors

In my theme the top menu is like this: <nav> <ul> <li> <a class=’active’ data-scroll-nav=’0′>Home</a> </li> <li> <a data-scroll-nav=’1′>Services</a> </li> </ul> </nav> By using a custom walker function, I’ve been able to clean the ul and li tags of unwanted classes and IDs. Now I need to to add “data-scroll-nav”. How do I write a […]

Link from navbar to categories

I have a navigation bar in homepage. I don’t want show categories in navigation bar. I also do not want use a dropdown menu. I just want to have a link to a page that show all categories. I want when clicked a link in this case categories, my categories show like below: but don’t […]

add taxonomy as one of menu items

I have created a custom Taxonomy called Documents and I want to show it as one of menu items, I am only able to choose from its posts. How shall I do that? As below picture I am not able to choose Documents itself as a menu item…