Adding two same css class on menu item
Adding two same css class on menu item
Adding two same css class on menu item
It seems to me, you are trying to get the ancestors by the actual post, while you most likely should get the ancestors according to the menu item. Why? Because setting up a hierarchy in the menu does not change the actual post, especially the post_parent property won’t be changed – in short: (other) post … Read more
Add default wp_nav_menu classes to my custom links
Please note, specific support questions to third party themes are off topic, so I will treat this in a general way, you should be able to implement this with your current theme To make your code work on only one menu, you need to target that specific menu only. To do that, you will need … Read more
I don’t really understand what you’re trying to do in your PHP. Simplest way (and, in my opinion, the more elegant solution, as this is a presentational issue) would be to do this in CSS. By default, WordPress puts plenty of helpful CSS in your <body> tag, e.g.: <body class=”single single-post postid-53 single-format-standard logged-in admin-bar”> … Read more
wp_is_mobile() inside js
You have a couple of options, depending on your specific needs. Option 1: Create a new post type If you need to create a new post type for “Issues”, the menu can be created automagically as part of the custom post type registration process. You can use a plugin like Types or you can register … Read more
How to inject HTML to secondary menu on front end?
I found the answer in nav-menu.php, it wasn’t too complicated. I just changed the foreach loop content like this : if($item->classes[0] == ‘subdomain1’ && !empty( $item->menu_item_parent )){ $item->menu_item_parent=””; }elseif($item->classes[0] == ‘main’ && $sub != ‘domain’){ unset($items[$key]); } Hope it can help !
How to style wp_nav_menu?