Permalink
Browse files

[ Specification change ] Separating sidebar code to sidebar.php

  • Loading branch information...
kurudrive committed Mar 11, 2016
1 parent 3f57ab7 commit bb470ac67bbaa319958ab1d9e54edc3785cafdd0
Showing with 38 additions and 37 deletions.
  1. +1 −37 page.php
  2. +37 −0 sidebar-page.php
@@ -30,43 +30,7 @@
</main><!-- [ /.mainSection ] -->
<div class="col-md-3 col-md-offset-1 subSection">
<?php
if ( is_active_sidebar( 'common-side-top-widget-area' ) )
dynamic_sidebar( 'common-side-top-widget-area' );
// Display post type widget area
$widdget_area_name = 'page-side-widget-area';
if ( is_active_sidebar( $widdget_area_name ) ){
dynamic_sidebar( $widdget_area_name );
} else {
if($post->ancestors){
foreach($post->ancestors as $post_anc_id){
$post_id = $post_anc_id;
} // foreach($post->ancestors as $post_anc_id){
} else {
$post_id = $post->ID;
} // if($post->ancestors){
if ($post_id) {
$children = wp_list_pages("title_li=&child_of=".$post_id."&echo=0");
if ($children) { ?>
<aside class="widget widget_archive">
<nav class="localNav">
<h1 class="subSection-title"><?php echo get_the_title($post_id); ?></h1>
<ul>
<?php echo $children; ?>
</ul>
</nav>
</aside>
<?php } // if ($children)
} // if ($post_id)
} // if ( is_active_sidebar( $widdget_area_name ) ){
if ( is_active_sidebar( 'common-side-bottom-widget-area' ) )
dynamic_sidebar( 'common-side-bottom-widget-area' );
?>
<?php get_sidebar(get_post_type()); ?>
</div><!-- [ /.subSection ] -->
</div><!-- [ /.row ] -->
@@ -0,0 +1,37 @@
<?php
if ( is_active_sidebar( 'common-side-top-widget-area' ) )
dynamic_sidebar( 'common-side-top-widget-area' );
// Display post type widget area
$widdget_area_name = 'page-side-widget-area';
if ( is_active_sidebar( $widdget_area_name ) ){
dynamic_sidebar( $widdget_area_name );
} else {
if($post->ancestors){
foreach($post->ancestors as $post_anc_id){
$post_id = $post_anc_id;
} // foreach($post->ancestors as $post_anc_id){
} else {
$post_id = $post->ID;
} // if($post->ancestors){
if ($post_id) {
$children = wp_list_pages("title_li=&child_of=".$post_id."&echo=0");
if ($children) { ?>
<aside class="widget widget_archive">
<nav class="localNav">
<h1 class="subSection-title"><?php echo get_the_title($post_id); ?></h1>
<ul>
<?php echo $children; ?>
</ul>
</nav>
</aside>
<?php } // if ($children)
} // if ($post_id)
} // if ( is_active_sidebar( $widdget_area_name ) ){
if ( is_active_sidebar( 'common-side-bottom-widget-area' ) )
dynamic_sidebar( 'common-side-bottom-widget-area' );
?>

0 comments on commit bb470ac

Please sign in to comment.