Hello,
I hope this fix the sidebar issue. First open includes > admin > register-widget-area.php and find this code
register_sidebar(array(
'name' => 'Displayed Everywhere',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '<span class="seperator extralight-border"></span></div>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>',
));
Replace it with
register_sidebar(array(
'id' => 'display_everywhere',
'name' => 'Displayed Everywhere',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '<span class="seperator extralight-border"></span></div>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>',
));
After that, please remove everything on your sidebar.php and replace it with this code. Once you copy the code, everything on 'Display Everywhere' widget area will be reset so you have to supply widgets on that area again. This is the code.
<?php
global $avia_config, $custom_widget_area;
ob_start();
$default_sidebar = true;
if(!empty($avia_config['currently_viewing_dynamic_overwrite'])) {$avia_config['currently_viewing'] = $avia_config['currently_viewing_dynamic_overwrite'];}
if ($avia_config['currently_viewing'] != "fullwidth") // check if its a full width page, if full width dont show the sidebar content
{
##############################################################################
# Display the sidebar menu
##############################################################################
//check if we should display the left, right or both sidebars
if(strpos($avia_config['layout'], 'sidebar_left') !== false) $sidebars_to_show = array('left');
if(strpos($avia_config['layout'], 'sidebar_right') !== false) $sidebars_to_show = array('right');
if(strpos($avia_config['layout'], 'dual-sidebar') !== false) $sidebars_to_show = array('left','right');
$subNav = avia_get_option('page_nesting_nav');
//display the sidebars
if(!empty($sidebars_to_show) && is_array($sidebars_to_show))
{
foreach ($sidebars_to_show as $sidebar)
{
$default_sidebar = true;
echo "<div class='sidebar units sidebar_".$sidebar." ".$avia_config['sidebar_class']."'>";
echo "<div class='inner_sidebar extralight-border'>";
/*
* Display a subnavigation for pages that is automatically generated, so the users doesnt need to work with widgets
*/
$sidebar_menu = "";
if($subNav && isset($post) && is_object($post) && !empty($post->ID) && is_page())
{
global $post;
$subNav = false;
$parent = $post->ID;
$sidebar_menu = "";
if (!empty($post->post_parent))
{
if(isset($post->ancestors)) $ancestors = $post->ancestors;
if(!isset($ancestors)) $ancestors = get_post_ancestors($post->ID);
$root = count($ancestors)-1;
$parent = $ancestors[$root];
}
$children = wp_list_pages("title_li=&child_of=". $parent ."&echo=0");
if ($children)
{
$default_sidebar = false;
$sidebar_menu .= "<div class='widget widget_nav_menu'><ul class='nested_nav'>";
$sidebar_menu .= $children;
$sidebar_menu .= "</ul></div>";
}
}
echo apply_filters('avia_sidebar_menu_filter', $sidebar_menu);
// single shop sidebars
if ($avia_config['currently_viewing'] == 'shop_single' && dynamic_sidebar('Single Product Pages') ) : $default_sidebar = false; endif;
// general shop sidebars
if ($avia_config['currently_viewing'] == 'shop' && dynamic_sidebar('Shop Overview Page') ) : $default_sidebar = false; endif;
// general blog sidebars
if ($avia_config['currently_viewing'] == 'blog' && dynamic_sidebar('Sidebar Blog') ) : $default_sidebar = false; endif;
// general pages sidebars
if ($avia_config['currently_viewing'] == 'page' && dynamic_sidebar('Sidebar Pages') ) : $default_sidebar = false; endif;
// forum pages sidebars
if ($avia_config['currently_viewing'] == 'forum' && dynamic_sidebar('Forum') ) : $default_sidebar = false; endif;
function remove_some_sidebars(){
// Unregsiter some Display Everywhere
unregister_sidebar( 'display_everywhere' );
}
add_action( 'widgets_init', 'remove_some_widgets', 11 );
$custom_widget_area = avia_check_custom_widget('page');
//$active_sidebar = dynamic_sidebar('Page: '.$custom_widget_area);
if (function_exists('dynamic_sidebar') && dynamic_sidebar('Page: '.$custom_widget_area) ) {
remove_some_sidebars();
$default_sidebar = false;
}
$custom_widget_area = avia_check_custom_widget('cat');
//unique Category sidebars:
if (function_exists('dynamic_sidebar') && dynamic_sidebar('Category: '.$custom_widget_area) ) : $default_sidebar = false; endif;
function register_sidebar_again() {
register_sidebar(array(
'id' => 'display_everywhere',
'name' => 'Displayed Everywhere',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '<span class="seperator extralight-border"></span></div>',
'before_title' => '<h3 class="widgettitle">',
'after_title' => '</h3>',
));
}
add_action( 'widgets_init', 'register_sidebar_again', 10 );
//sidebar area displayed everywhere
if (function_exists('dynamic_sidebar') && $avia_config['currently_viewing'] != 'shop_single' && dynamic_sidebar('Displayed Everywhere')) {
register_sidebar_again();
$default_sidebar = false;
}
//default dummy sidebar
if ($default_sidebar)
{
avia_dummy_widget(2);
avia_dummy_widget(3);
avia_dummy_widget(4);
}
echo "</div>";
echo "</div>";
}
}
}
$output = ob_get_clean();
if(($avia_config['currently_viewing'] != "shop_single" && $default_sidebar) || $default_sidebar == false) echo $output;
wp_reset_query();
?>
Hope it works.
Regards,
Ismael