← Back
Editing: sidebar.php
<?php /** * The Sidebar containing the main widget areas. * * @package INFRATECH * @since INFRATECH 1.0 */ if ( infratech_sidebar_present() ) { $infratech_sidebar_type = infratech_get_theme_option( 'sidebar_type' ); if ( 'custom' == $infratech_sidebar_type && ! infratech_is_layouts_available() ) { $infratech_sidebar_type = 'default'; } // Catch output to the buffer ob_start(); if ( 'default' == $infratech_sidebar_type ) { // Default sidebar with widgets $infratech_sidebar_name = infratech_get_theme_option( 'sidebar_widgets' ); infratech_storage_set( 'current_sidebar', 'sidebar' ); if ( is_active_sidebar( $infratech_sidebar_name ) ) { dynamic_sidebar( $infratech_sidebar_name ); } } else { // Custom sidebar from Layouts Builder $infratech_sidebar_id = infratech_get_custom_sidebar_id(); do_action( 'infratech_action_show_layout', $infratech_sidebar_id ); } $infratech_out = trim( ob_get_contents() ); ob_end_clean(); // If any html is present - display it if ( ! empty( $infratech_out ) ) { $infratech_sidebar_position = infratech_get_theme_option( 'sidebar_position' ); $infratech_sidebar_position_ss = infratech_get_theme_option( 'sidebar_position_ss', 'below' ); ?> <div class="sidebar widget_area <?php echo ' ' . esc_attr( $infratech_sidebar_position ); echo ' sidebar_' . esc_attr( $infratech_sidebar_position_ss ); echo ' sidebar_' . esc_attr( $infratech_sidebar_type ); $infratech_sidebar_scheme = apply_filters( 'infratech_filter_sidebar_scheme', infratech_get_theme_option( 'sidebar_scheme', 'inherit' ) ); if ( ! empty( $infratech_sidebar_scheme ) && ! infratech_is_inherit( $infratech_sidebar_scheme ) && 'custom' != $infratech_sidebar_type ) { echo ' scheme_' . esc_attr( $infratech_sidebar_scheme ); } ?> " role="complementary"> <?php // Skip link anchor to fast access to the sidebar from keyboard ?> <span id="sidebar_skip_link_anchor" class="infratech_skip_link_anchor"></span> <?php do_action( 'infratech_action_before_sidebar_wrap', 'sidebar' ); // Button to show/hide sidebar on mobile if ( in_array( $infratech_sidebar_position_ss, array( 'above', 'float' ) ) ) { $infratech_title = apply_filters( 'infratech_filter_sidebar_control_title', 'float' == $infratech_sidebar_position_ss ? esc_html__( 'Show Sidebar', 'infratech' ) : '' ); $infratech_text = apply_filters( 'infratech_filter_sidebar_control_text', 'above' == $infratech_sidebar_position_ss ? esc_html__( 'Show Sidebar', 'infratech' ) : '' ); ?> <a href="#" role="button" class="sidebar_control" title="<?php echo esc_attr( $infratech_title ); ?>"><?php echo esc_html( $infratech_text ); ?></a> <?php } ?> <div class="sidebar_inner"> <?php do_action( 'infratech_action_before_sidebar', 'sidebar' ); infratech_show_layout( preg_replace( "/<\/aside>[\r\n\s]*<aside/", '</aside><aside', $infratech_out ) ); do_action( 'infratech_action_after_sidebar', 'sidebar' ); ?> </div> <?php do_action( 'infratech_action_after_sidebar_wrap', 'sidebar' ); ?> </div> <div class="clearfix"></div> <?php } }
Save File
Cancel