Show if sub page
-
Great plugin! However is there a way to show a menu item on parent and subpages? It seem like you should be able to do this
add_filter( 'if_menu_conditions', 'my_new_menu_condition' ); function my_new_menu_condition( $conditions ) { global $post; $conditions[] = array( 'name' => 'Condition Name', // name of the condition 'condition' => function($item) { // callback - must return TRUE or FALSE return is_page('Parent Page' ) || is_page('Parent Page' ) && $post->post_parent > 0; } ); return $conditions; }
But doesn’t seem to work.
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Show if sub page’ is closed to new replies.