Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
1c92807c95
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 57 lines (51 sloc) 1.63 KB
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package cornerstone
*/
get_header(); ?>
<?php
// sidebar custom field check.
$sidebar = get_post_meta( get_the_ID(), 'uc_sidebar', true );
if( !is_active_sidebar( $sidebar ) ){
foreach(get_post_ancestors(get_the_ID()) as $ancestor){
$parent_sidebar = get_post_meta( $ancestor, 'uc_sidebar', true );
$parent_sidebar_children = get_post_meta( $ancestor, 'uc_sidebar_children', true );
if( is_active_sidebar( $parent_sidebar ) && $parent_sidebar_children != '' && $parent_sidebar_children ){
$sidebar = $parent_sidebar;
break;
}
}
}
?>
<div class="row">
<div class="col-md-<?php echo (is_active_sidebar( $sidebar )?9:12); ?>">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() ) :
comments_template();
endif;
?>
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
</div>
<?php
if ( is_active_sidebar( $sidebar ) ) {
echo '<div class="col-sm-3">';
dynamic_sidebar( $sidebar );
echo '</div>';
}
?>
</div><!-- /row -->
<?php get_footer(); ?>