From: Anthony Talarico Date: Tue, 23 Feb 2016 20:19:43 +0000 (-0500) Subject: added is_tree function for pages not in appearance menu X-Git-Tag: v1.0.0^2~147 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=9c9e8f5438e5b27a67c2af37663a2719f3e009f0;p=WP-Themes%2FDiscoverKZOO.git added is_tree function for pages not in appearance menu --- diff --git a/functions.php b/functions.php index 4452850..c661594 100644 --- a/functions.php +++ b/functions.php @@ -149,7 +149,20 @@ function mytheme_search_loop() { ID ); + foreach ( $anc as $ancestor ) { + if( is_page() && $ancestor == $pid ) { + return true; + } + } + return false; +} add_action('thematic_searchloop', 'mytheme_search_loop'); // End of the Contextual/Highlight Search functions ?> diff --git a/lib/navigation.php b/lib/navigation.php index 69d49c1..a162c63 100644 --- a/lib/navigation.php +++ b/lib/navigation.php @@ -181,7 +181,9 @@ function glm_get_menu_options() //} function glm_side_menu($mobile = false) { global $post; - if( !is_page(array(3200, 3201,3202,3203))){ + + // do not use appearance menu for the following page ID's or their ancestors + if( !is_page(array(3200, 3201,3202,3203)) && !is_tree(3200) && !is_tree(3201) && !is_tree(3202) && !is_tree(3203)){ $sideMenu = $allMenu = $pageMenuId = array(); if (($locations = get_nav_menu_locations()) && isset($locations['top-bar'])) { @@ -256,8 +258,9 @@ function glm_side_menu($mobile = false) { echo ''; } echo ''; +// using page menu here for the listed page ID's above } else { - global $post; + $parents = get_post_ancestors($post->ID); $id = ($parents) ? $parents[count($parents)-1]: $post->ID; $parent = get_page( $id );