* This function returns true when the current page is the page given by ID
* or a descendent thereof.
*/
-if (!function_exists('is_in_tree')) {
- function is_in_tree( $pid ) {
- global $post;
- if ( is_page( $pid ) ) {
- return true;
- }
- if ($post) {
- $anc = get_post_ancestors( $post->ID );
- foreach ( $anc as $ancestor ) {
- if( is_page() && $ancestor == $pid ) {
- return true;
- }
+function is_in_tree_theme( $pid, $pageID ) {
+ if ( is_page( $pid ) ) {
+ return true;
+ }
+ if ( $pageID ) {
+ $anc = get_post_ancestors( $pageID );
+
+ foreach ( $anc as $ancestor ) {
+ if( $ancestor == $pid ) {
+ return true;
}
}
- return false;
}
+ return false;
}
+// if (!function_exists('is_in_tree')) {
+// function is_in_tree( $pid, $pageID = false ) {
+
+// if ( is_page( $pid ) ) {
+// return true;
+// }
+
+// if ( $pageID ) {
+
+// $anc = get_post_ancestors( $pageID );
+// foreach ( $anc as $ancestor ) {
+// if( $ancestor == $pid ) {
+// return true;
+// }
+// }
+// }
+// return false;
+// }
+// }
// The GLM Simple Messageboard needs this function to display its data
if ( !function_exists( 'glm_get_simplemessageboard_option' ) ) {
<a class="logo-link" href="<?php echo get_bloginfo('url'); ?>"><img class="small-header-logo" src="<?php echo get_template_directory_uri();?>/assets/logo.png" alt=""></a>
</div>
-
+
<nav class="large-12 columns top-bar text-center show-for-large-up opensearchserver.ignore" data-topbar role="navigation" data-options="sticky_on: large">
<section class="top-bar-section">
<?php
- if(is_in_tree(OWNERS_FRONTPAGE_ID) ):
- glm_theme_top_bar('owners');
+ global $post;
+ if( is_home() ){
+ $page_id = get_option( 'page_for_posts' );
+ }else{
+ $page_id = $post->ID;
+ }
+
+ if(is_in_tree_theme(OWNERS_FRONTPAGE_ID, $page_id) ):
+ glm_theme_top_bar('owners');
else:
glm_theme_top_bar('public');
endif;