add_action('thematic_searchloop', 'mytheme_search_loop');
// End of the Contextual/Highlight Search functions
+
+function is_tree( $pid ) {
+ global $post;
+
+ if ( is_page($pid) )
+ return true;
+
+ $anc = get_post_ancestors( $post->ID );
+ foreach ( $anc as $ancestor ) {
+ if( is_page() && $ancestor == $pid ) {
+ return true;
+ }
+ }
+ return false;
+}
?>
// echo '</ul><!-- end -->'."\n";
//}
function glm_side_menu($mobile = false) {
-
+
global $post;
+
$sideMenu = $allMenu = $pageMenuId = array();
- echo $post->ID;
+// echo $post->ID;
// if (($locations = get_nav_menu_locations()) && isset($locations['top-bar-1'])) {
// $menu = wp_get_nav_menu_object($locations['top-bar-1']);
// }
- if(is_page(2666) || 2666 == $post->post_parent){
+ if(is_page(2666) || 2666 == $post->post_parent || is_tree(2666)){
if (($locations = get_nav_menu_locations()) && isset($locations['top-bar-1'])) {
$menu = wp_get_nav_menu_object($locations['top-bar-1']);
}
}
- if(is_page(2665) || 2665 == $post->post_parent){
+ if(is_page(2665) || 2665 == $post->post_parent || is_tree(2665)){
if (($locations = get_nav_menu_locations()) && isset($locations['top-bar-2'])) {
$menu = wp_get_nav_menu_object($locations['top-bar-2']);
}
}
- if(is_page(4593) || 4593 == $post->post_parent){
+ if(is_page(4593) || 4593 == $post->post_parent || is_tree(4593)){
if (($locations = get_nav_menu_locations()) && isset($locations['top-bar-3'])) {
$menu = wp_get_nav_menu_object($locations['top-bar-3']);
}
}
- if(is_page(2664) || 2664 == $post->post_parent){
+ if(is_page(2664) || 2664 == $post->post_parent || is_tree(2664)){
if (($locations = get_nav_menu_locations()) && isset($locations['top-bar-4'])) {
$menu = wp_get_nav_menu_object($locations['top-bar-4']);
}
}
- if(is_page(3363) || 3363 == $post->post_parent){
+ if(is_page(3363) || 3363 == $post->post_parent || is_tree(3363)){
if (($locations = get_nav_menu_locations()) && isset($locations['top-bar-6'])) {
$menu = wp_get_nav_menu_object($locations['top-bar-6']);
}