?>bar Right', 'elearning' ),
'sidebar-left' => esc_html__( 'Sidebar Left', 'elearning' ),
'header-top-left-sidebar' => esc_html__( 'Header Top Bar Left Sidebar', 'elearning' ),
'header-top-right-sidebar' => esc_html__( 'Header Top Bar Right Sidebar', 'elearning' ),
'footer-sidebar-1' => esc_html__( 'Footer One', 'elearning' ),
'footer-sidebar-2' => esc_html__( 'Footer Two', 'elearning' ),
'footer-sidebar-3' => esc_html__( 'Footer Three', 'elearning' ),
'footer-sidebar-4' => esc_html__( 'Footer Four', 'elearning' ),
'footer-bar-left-sidebar' => esc_html__( 'Footer Bottom Bar Left Sidebar', 'elearning' ),
'footer-bar-right-sidebar' => esc_html__( 'Footer Bottom Bar Right Sidebar', 'elearning' ),
)
);
foreach ( $sidebars as $id => $name ) {
register_sidebar(
apply_filters(
'elearning_sidebars_widget_args',
array(
'id' => $id,
'name' => $name,
'description' => esc_html__( 'Add widgets here.', 'elearning' ),
'before_widget' => '',
'before_title' => '
',
)
)
);
}
}
add_action( 'widgets_init', 'elearning_widgets_init' );
endif;
if ( ! function_exists( 'elearning_content_width' ) ) {
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function elearning_content_width() {
$GLOBALS['content_width'] = apply_filters( 'elearning_content_width', 640 );
}
add_action( 'after_setup_theme', 'elearning_content_width', 0 );
}
if ( ! function_exists( 'elearning_scripts' ) ) {
/**
* Enqueue scripts and styles.
*/
function elearning_scripts() {
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
wp_register_style( 'font-awesome', get_template_directory_uri() . '/assets/lib/font-awesome/css/font-awesome' . $suffix . '.css', false, '4.7.0' );
wp_enqueue_style( 'font-awesome' );
wp_register_style( 'elearning-style', get_stylesheet_uri(), array(), ELEARNING_THEME_VERSION );
wp_enqueue_style( 'elearning-style' );
wp_style_add_data( 'elearning-style', 'rtl', 'replace' );
add_filter( 'elearning_dynamic_theme_css', array( 'elearning_Dynamic_CSS', 'render_output' ) );
// Enqueue required Google font.
eLearning_Generate_Fonts::render_fonts();
// Generate dynamic CSS to add inline styles.
$theme_dynamic_css = apply_filters( 'elearning_dynamic_theme_css', '' );
wp_add_inline_style( 'elearning-style', $theme_dynamic_css );
wp_enqueue_style( 'elearning-mto-style', get_template_directory_uri() . '/masteriyo.css', array( 'masteriyo-public' ), ELEARNING_THEME_VERSION );
// Do not load scripts if AMP.
if ( elearning_is_amp() ) {
return;
}
wp_enqueue_script( 'elearning-navigation', get_template_directory_uri() . '/assets/js/navigation' . $suffix . '.js', array(), ELEARNING_THEME_VERSION, true );
wp_enqueue_script( 'elearning-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix' . $suffix . '.js', array(), ELEARNING_THEME_VERSION, true );
wp_enqueue_script( 'elearning-custom', get_template_directory_uri() . '/assets/js/elearning-custom' . $suffix . '.js', array(), ELEARNING_THEME_VERSION, true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'elearning_scripts' );
}
if ( ! function_exists( 'elearning_block_editor_styles' ) ) {
/**
* Enqueue block editor styles.
*
* @since elearning 1.0.0
*/
function elearning_block_editor_styles() {
wp_enqueue_style( 'elearning-block-editor-styles', get_template_directory_uri() . '/style-editor-block.css', array(), ELEARNING_THEME_VERSION );
}
add_action( 'enqueue_block_editor_assets', 'elearning_block_editor_styles', 1, 1 );
}
// AMP support files.
if ( defined( 'AMP__VERSION' ) && ( ! version_compare( AMP__VERSION, '1.0.0', '<' ) ) ) {
require_once ELEARNING_PARENT_INC_DIR . '/compatibility/amp/class-elearning-amp.php';
}
/**
* Include files.
*/
require ELEARNING_PARENT_INC_DIR . '/class-elearning-utils.php';
require ELEARNING_PARENT_INC_DIR . '/hooks.php';
require ELEARNING_PARENT_INC_DIR . '/structure/header.php';
require ELEARNING_PARENT_INC_DIR . '/structure/content.php';
require ELEARNING_PARENT_INC_DIR . '/structure/footer.php';
require ELEARNING_PARENT_INC_DIR . '/custom-header.php';
require ELEARNING_PARENT_INC_DIR . '/class-elearning-dynamic-filter.php';
require ELEARNING_PARENT_INC_DIR . '/template-tags.php';
require ELEARNING_PARENT_INC_DIR . '/template-functions.php';
require ELEARNING_PARENT_INC_DIR . '/customizer/class-elearning-customizer.php';
require ELEARNING_PARENT_INC_DIR . '/class-elearning-css-classes.php';
require ELEARNING_PARENT_INC_DIR . '/class-elearning-dynamic-css.php';
defined( 'JETPACK__VERSION' ) && require ELEARNING_PARENT_INC_DIR . '/compatibility/jetpack/class-elearning-jetpack.php';
require ELEARNING_PARENT_INC_DIR . '/class-breadcrumb-trail.php';
require ELEARNING_PARENT_INC_DIR . '/compatibility/elementor/class-elearning-elementor-pro.php';
require ELEARNING_PARENT_INC_DIR . '/compatibility/masteriyo/class-elearning-masteriyo.php';
if ( is_admin() ) {
// Meta boxes.
require ELEARNING_PARENT_INC_DIR . '/meta-boxes/class-elearning-meta-box-page-settings.php';
require ELEARNING_PARENT_INC_DIR . '/meta-boxes/class-elearning-meta-box.php';
// Theme options page.
require ELEARNING_PARENT_INC_DIR . '/admin/class-elearning-admin.php';
require ELEARNING_PARENT_INC_DIR . '/admin/class-elearning-notice.php';
require ELEARNING_PARENT_INC_DIR . '/admin/class-elearning-welcome-notice.php';
require ELEARNING_PARENT_INC_DIR . '/admin/class-elearning-dashboard.php';
require ELEARNING_PARENT_INC_DIR . '/admin/class-elearning-theme-review-notice.php';
}
?>