Skip to content
Permalink
a88292317b
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
14 lines (14 sloc) 522 Bytes
<?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;
}
}
}
?>