How to target grandchild of post_parent using wp_list_pages

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

Add code to WordPress menu items by class

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