File: /var/www/vhosts/miroglu.net/httpdocs/wp-content/themes/the-landscaper/inc/theme-sidebars.php
<?php
/**
* Register widget area.
*
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
* @package the-landscaper-wp
*/
function thelandscaper_sidebars() {
// Set id back to sidebar-1 for new theme installations
$sidebar_name = ( is_active_sidebar( 'sidebar' ) ) ? 'sidebar' : 'sidebar-1';
// Blog Page Sidebar
register_sidebar( array(
'name' => esc_html__( 'Blog Sidebar', 'the-landscaper-wp' ),
'id' => $sidebar_name,
'description' => esc_html__( 'Widgets for the blog sidebar', 'the-landscaper-wp' ),
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="widget-title">',
'after_title' => '</h6>',
) );
// Topbar - Left
register_sidebar( array(
'name' => esc_html__( 'Topbar - Left Side', 'physio-qt' ),
'description' => esc_html__( 'Widget area for the header topbar. Please limit to text, social, icon box or menu widget', 'the-landscaper-wp' ),
'id' => 'topbar-widgets-left',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
) );
// Topbar - Right
register_sidebar( array(
'name' => esc_html__( 'Topbar - Right Side', 'the-landscaper-wp' ),
'description' => esc_html__( 'Widget area for the header topbar. Please limit to text, social, icon box or menu widget', 'the-landscaper-wp' ),
'id' => 'topbar-widgets',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
) );
// Header Overlay Sidebar
register_sidebar( array(
'name' => esc_html__( 'Header Overlay Layout', 'the-landscaper-wp' ),
'description' => esc_html__( 'This area is only used for the header overlay layout. For all other header layouts use the "Topbar" panel ', 'the-landscaper-wp'),
'id' => 'header-widgets',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
) );
// Page Sidebar
register_sidebar( array(
'name' => esc_html__( 'Page Sidebar', 'the-landscaper-wp' ),
'description' => esc_html__( 'Widgets for the default page(s) sidebar', 'the-landscaper-wp'),
'id' => 'page-sidebar',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="widget-title">',
'after_title' => '</h6>',
) );
// WooCommerce Shop Sidebar
if ( thelandscaper_woocommerce_active() ) {
register_sidebar( array(
'name' => esc_html__( 'Shop Sidebar', 'the-landscaper-wp'),
'description' => esc_html__( 'Widgets for the WooCommerce shop sidebar', 'the-landscaper-wp'),
'id' => 'shop-sidebar',
'class' => 'sidebar',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="widget-title">',
'after_title' => '</h6>'
) );
}
// Footer
$main_footer_columns = (int) get_theme_mod( 'qt_footer_columns', 4 );
if ( $main_footer_columns > 0 ) {
register_sidebar(
array(
'name' => esc_html__( 'Footer', 'the-landscaper-wp' ),
'description' => esc_html__( 'Widgets for the theme footer. Change columns at: Appearance > Customize > Theme Options > Footer.', 'the-landscaper-wp' ),
'id' => 'main-footer',
'before_widget' => sprintf( '<div class="col-xs-12 col-md-%d"><div class="widget w-footer %%2$s">', round( 12 / $main_footer_columns ) ),
'after_widget' => '</div></div>',
'before_title' => '<h6 class="widget-title">',
'after_title' => '</h6>'
)
);
}
// Bottom Footer - Left
$bottom_footer_left = get_theme_mod( 'qt_footerbottom_textleft' );
if ( ! $bottom_footer_left ) {
register_sidebar( array(
'name' => esc_html__( 'Bottom Footer - Left', 'the-landscaper-wp' ),
'description' => esc_html__( 'Widgets for the left bottom footer', 'the-landscaper-wp'),
'id' => 'bottom-footer-left',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="widget-title">',
'after_title' => '</h6>',
) );
}
// Bottom Footer - Middle
$bottom_footer_middle = get_theme_mod( 'qt_footerbottom_textmiddle' );
if ( ! $bottom_footer_middle ) {
register_sidebar( array(
'name' => esc_html__( 'Bottom Footer - Middle', 'the-landscaper-wp' ),
'id' => 'bottom-footer-middle',
'description' => esc_html__( 'Widgets for the middle bottom footer', 'the-landscaper-wp'),
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="widget-title">',
'after_title' => '</h6>',
) );
}
// Bottom Footer - Right
$bottom_footer_right = get_theme_mod( 'qt_footerbottom_textright' );
if ( ! $bottom_footer_right ) {
register_sidebar( array(
'name' => esc_html__( 'Bottom Footer - Right', 'the-landscaper-wp' ),
'id' => 'bottom-footer-right',
'description' => esc_html__( 'Widgets for the right bottom footer', 'the-landscaper-wp'),
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h6 class="widget-title">',
'after_title' => '</h6>',
) );
}
}
add_action( 'widgets_init', 'thelandscaper_sidebars' );