array( 'name' => __( 'Left Sidebar', 'pen' ), 'description' => '', ), 'right' => array( 'name' => __( 'Right Sidebar', 'pen' ), 'description' => '', ), 'header-primary' => array( 'name' => __( 'Header - Primary', 'pen' ), 'description' => __( '(Stays in the middle of the header)', 'pen' ), ), 'header-secondary' => array( 'name' => __( 'Header - Secondary', 'pen' ), 'description' => __( '(Stays at the right of the header)', 'pen' ), ), 'search-top' => array( 'name' => __( 'Search - Top', 'pen' ), 'description' => __( 'Located above the bigger search box.', 'pen' ), ), 'search-left' => array( 'name' => __( 'Search - Left', 'pen' ), 'description' => __( 'Located left side of the bigger search box.', 'pen' ), ), 'search-right' => array( 'name' => __( 'Search - Right', 'pen' ), 'description' => __( 'Located right side of the bigger search box.', 'pen' ), ), 'search-bottom' => array( 'name' => __( 'Search - Bottom', 'pen' ), 'description' => __( 'Located beneath the bigger search box.', 'pen' ), ), 'top' => array( 'name' => __( 'Top', 'pen' ), 'description' => __( 'Located above the content area below the header and the navigation menu.', 'pen' ), ), 'bottom' => array( 'name' => __( 'Bottom', 'pen' ), 'description' => __( 'Located beneath the content area.', 'pen' ), ), 'content-top' => array( 'name' => __( 'Content - Top', 'pen' ), 'description' => __( 'Located above the content.', 'pen' ), ), 'content-bottom' => array( 'name' => __( 'Content - Bottom', 'pen' ), 'description' => __( 'Located beneath the content.', 'pen' ), ), 'footer-top' => array( 'name' => __( 'Footer - Top', 'pen' ), 'description' => '', ), 'footer-left' => array( 'name' => __( 'Footer - Left', 'pen' ), 'description' => '', ), 'footer-right' => array( 'name' => __( 'Footer - Right', 'pen' ), 'description' => '', ), 'footer-bottom' => array( 'name' => __( 'Footer - Bottom', 'pen' ), 'description' => '', ), ); /* phpcs:enable */ foreach ( $sidebars as $id => $sidebar ) { register_sidebar( array( 'name' => esc_html( $sidebar['name'] ), 'id' => 'sidebar-' . esc_attr( $id ), 'description' => esc_html( $sidebar['description'] ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } } add_action( 'widgets_init', 'pen_sidebars_register' ); } if ( ! function_exists( 'pen_sidebar_get' ) ) { /** * Sidebars. * * @param string $sidebar The sidebar ID. * * @since Pen 1.0.0 * @return void */ function pen_sidebar_get( $sidebar ) { if ( ! is_registered_sidebar( $sidebar ) ) { return; } if ( pen_sidebar_check( $sidebar ) && is_active_sidebar( $sidebar ) ) { $classes = trim( implode( ' ', array_filter( array( 'sidebar', 'clearfix', 'widget-area', ) ) ) ); if ( 'sidebar-bottom' === $sidebar ) { if ( pen_option_get( 'color_bottom_background_transparent' ) ) { $classes .= ' pen_is_transparent'; } else { $classes .= ' pen_not_transparent'; } } ?>