| Server IP : 198.38.94.67 / Your IP : 216.73.217.178 Web Server : LiteSpeed System : Linux d6054.dxb1.stableserver.net 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64 User : azfilmst ( 1070) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/azfilmst/public_html/wp-content/themes/frames/framework/includes/ |
Upload File : |
<?php
/**
* @package HaruTheme
* @version 1.0.0
* @author Administrator <admin@harutheme.com>
* @copyright Copyright (c) 2017, HaruTheme
* @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later
* @link http://harutheme.com
*/
/* Purpose: Register sidebar and add more custom sidebar via AJAX
* Files: theme-functions.php, haru-custom-sidebar.js, admin-style.css
*/
if ( !function_exists('haru_register_sidebar') ) {
function haru_register_sidebar() {
register_sidebar(
array(
'name' => esc_html__( 'Sidebar Blog 1','frames' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Widget Area 1 for Archive or Single Blog','frames' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h4 class="widget-title"><span>',
'after_title' => '</span></h4>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Sidebar Blog 2','frames' ),
'id' => 'sidebar-2',
'description' => esc_html__( 'Widget Area 2 for Archive or Single Blog','frames' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h4 class="widget-title"><span>',
'after_title' => '</span></h4>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'WooCommerce','frames' ),
'id' => 'woocommerce',
'description' => esc_html__( 'WooCommerce Sidebar','frames' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h4 class="widget-title"><span>',
'after_title' => '</span></h4>',
)
);
if ( true == haru_check_core_plugin_status() ) {
register_sidebar(
array(
'name' => esc_html__( 'WooCommerce Ajax Filter', 'frames' ),
'id' => 'woocommerce_ajax_filter',
'description' => esc_html__( 'WooCommerce Sidebar Ajax Filter', 'frames' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h4 class="widget-title"><span>',
'after_title' => '</span></h4>',
)
);
// Add custom sidebar using ajax
$custom_sidebars = haru_get_custom_sidebars();
if ( is_array( $custom_sidebars ) && ! empty( $custom_sidebars ) ) {
foreach ( $custom_sidebars as $name ) {
$haru_custom_sidebars[] = array(
'name' => '' . $name . '',
'id' => sanitize_title( $name ),
'description' => '',
'class' => 'haru-custom-sidebar',
'before_widget' => '<section id="%1$s" class="widget-container %2$s">',
'after_widget' => '</section>',
'before_title' => '<div class="widget-title-wrapper"><a class="block-control" href="javascript:void(0)"></a><h3 class="widget-title heading-title">',
'after_title' => '</h3></div>',
);
}
foreach ( $haru_custom_sidebars as $custom_sidebar ) {
register_sidebar( $custom_sidebar );
}
}
}
}
add_action( 'widgets_init', 'haru_register_sidebar' );
}