WordPress Quick Question . How to Get Parent Link in Submenu in My Code
WordPress Quick Question . How to Get Parent Link in Submenu in My Code
WordPress Quick Question . How to Get Parent Link in Submenu in My Code
The correct answer is: $Pages = wp_list_pages(‘child_of=”.($post->post_parent != false ? $post->post_parent : $post->ID).”&title_li=&echo=0&depth=1’); $InnerPages = wp_list_pages(‘child_of=”.($post->post_child != false ? $post->post_child : $post->ID).”&title_li=&echo=0′); $Title = ($post->post_child != false) ? trim(get_the_title($post->post_child)) : trim(wp_title(”, false)); if($Title != ”) $Pages = str_replace($Title.'</a></li>’, $Title.'</a>’. ‘<ul id=”test”><li>Overview</li>’.$InnerPages.'</ul></li>’, $Pages); echo $Pages; unset($Pages, $InnerPages); HOWEVER, I have found a much better solution to … Read more
Register submenu on network menu from the subsite
Adding a submenu to the Tools menu returns tools.php in a popup box
Define supporting only 1-level menu
Submenu causes issue in defined blog page
I imagine WordPress mustn’t allow that, so I ended up going with exclude instead <?php wp_list_pages(‘title_li&depth=2&exclude=4,214,18’); ?>
So yes, by far you should use the new event handlers instead of adding attributes to your html tags. (so your second method, in the footer) The reason your footer code didn’t work is because you didn’t quite figure out how to transfer from the attribute to the handler form… When you say onclick=”toggle_visibility(‘sub-menu’);” the … Read more
Check if menu_item has children or has parent
Custom Nav Walker sub-menu