Articles of menus

How to automatically redirect to first item of second navigation level in a multi-level menu?

I have a use case where my WP install is a bunch of pages with sub-pages. For example: HOME ABOUT – ABOUT US – HISTORY – PEOPLE – AWARDS PRODUCTS – PRODUCTS – INGREDIENTS – PROCESS I would like to establish a structure where clicking on the 1st level navigation item (“About”) takes you to […]

How to get the name of the homepage's menu?

I am trying to add a menu item programmatically through a plugin to a menu based on location and i want this to be added to the location that is attached to the homepage’s menu. This is my code: //Add user menu item add_filter( ‘wp_nav_menu_items’, ‘add_user_link’, 10, 2); /** * Add a login link to […]

(Solved) How to add a submenu toggle button inside all “li” elements that have a submenu?

I’m building a mobile navigation menu. I wan’t the menu to work like this: In this image you see a mobile nav with multiple depth levels. This is how I wan’t the code structure to look like: <ul> <li></li> <li class=”menu-item-has-children”> <div class=”toggle-button”></div> <a href=””></a> <ul class=”submenu”> <li></li> <li class=”menu-item-has-children”> <div class=”toggle-button”></div> <a href=””></a> <ul […]

The cart, checkout, and shop links not getting removed

I uninstalled woocommerce plugin but yet the shop, checkout and cart links in navigation bar is persistent. The theme I’m using is Compass. But whatever theme I choose those three links do not vanish. I want to create a simple blogging website for myself. Any suggestion is welcomed.

Disable parent in wp_list_pages – WordPress

I have the following code the generates the sitemap. wp_list_pages( array( ‘exclude’ => ‘5’, ‘sort_column’ => ‘ID’, ‘title_li’ => ” ) ); It generates a hierarchy of my Pages but it also has links to my parent pages. check the screenshot above. I only need the title for all the parents not the link. Please […]

How to remove the Navigation Bar (prim. and sec.) from the Homepage for the Genesis Framework?

How to remove the Navigation Bar (prim. and sec.) from the Homepage for the Genesis Framework?

Automatically going to the first page in a hierarchy?

Let’s say I have a website about different types of cars. The structure is a little like this: -Home -Cars (shows a submenu with a list of cars, ie Volvo 850, Porsche 911 ) -Volvo 850 overview (the page you get when you click Volvo 850 on the Car page) -Volvo 850 tech spec (the […]

Is there a way to tell menu items to force non-SSL URLs?

I’ve got a client site which uses SSL for only a small chunk of pages where users purchase subscriptions. So, for those pages, we just make sure that any links into them have hrefs with https://etc and everything’s fine. The problem is that once they’re finished with the purchase and exit those pages using any […]

WordPress Menu options in the Admin: Posts for the dropdowns

Under Appearance > Menus I seem to be able to add Categories, Pages, or Custom Links as my menu/sub-menu dropdown items…but I can’t add posts. I would like to have posts in my dropdown (posts of a given category), but I can’t seem to do this without writing custom links, which is going to be […]

Tageting a specific menu link with nav_menu_css_class

The following is my top-menu when rendered on page… <ul id=”top-menu” class=”menu”> … <li id=”menu-item-28″ class=”menu-item menu-item-type-post_type menu-item-object-page menu-item-28″><a href=”http://localhost:8082/demo/”>Demo</a></li> <li id=”menu-item-39″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-39″><a href=”http://google.com”>Contact Us</a></li> </ul> …what should my if($item) condition be to concatenate my_custom_class to .menu-item-39? add_filter(‘nav_menu_css_class’ , ‘my_nav_special_class’ , 10 , 2); function my_nav_special_class($classes, $item){ if($item){ //what should this condition […]