esc_html__( 'Header', 'alux' )
) );
// Load theme languages
load_theme_textdomain( 'alux', get_template_directory().'/languages' );
// Add support for editor styles.
add_theme_support( 'editor-styles' );
}
}
add_action( 'after_setup_theme', 'alux_setup' );
/* Register sidebars
/* ------------------------------------ */
if ( ! function_exists( 'alux_sidebars' ) ) {
function alux_sidebars() {
register_sidebar(array( 'name' => esc_html__( 'Primary', 'alux' ),'id' => 'primary','description' => esc_html__( 'Normal full width sidebar.', 'alux' ), 'before_widget' => '
','after_widget' => '
','before_title' => '','after_title' => '
'));
}
}
add_action( 'widgets_init', 'alux_sidebars' );
/* Enqueue javascript
/* ------------------------------------ */
if ( ! function_exists( 'alux_scripts' ) ) {
function alux_scripts() {
wp_enqueue_script( 'alux-script', get_template_directory_uri() . '/js/script.js', '','', true );
if ( is_singular() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); }
}
}
add_action( 'wp_enqueue_scripts', 'alux_scripts' );
/* Enqueue css
/* ------------------------------------ */
if ( ! function_exists( 'alux_styles' ) ) {
function alux_styles() {
$css_dependencies = array();
// Retrieve and enqueue the URL for Google Fonts
$google_fonts_url = Alux_Google_Fonts::get_google_fonts_url();
if ( $google_fonts_url ) {
wp_register_style( 'alux-google-fonts', $google_fonts_url, false, 1.0, 'all' );
$css_dependencies[] = 'alux-google-fonts';
}
// Filter the list of dependencies used by the alux-style CSS enqueue
$css_dependencies = apply_filters( 'alux_css_dependencies', $css_dependencies );
wp_enqueue_style( 'alux-style', get_template_directory_uri().'/style.css', $css_dependencies);
// Add output of Customizer settings as inline style
wp_add_inline_style( 'alux-style', Alux_Custom_CSS::get_customizer_css( 'front-end' ) );
}
}
add_action( 'wp_enqueue_scripts', 'alux_styles' );
function alux_block_editor_styles() {
$css_dependencies = array();
// Retrieve and enqueue the URL for Google Fonts
$google_fonts_url = Alux_Google_Fonts::get_google_fonts_url();
if ( $google_fonts_url ) {
wp_register_style( 'Alux_Google_Fonts', $google_fonts_url, false, 1.0, 'all' );
$css_dependencies[] = 'Alux_Google_Fonts';
}
// Enqueue the editor styles
wp_enqueue_style( 'alux_block_editor_styles', get_theme_file_uri( 'style-editor.css' ), $css_dependencies, wp_get_theme( 'alux' )->get( 'Version' ), 'all' );
// Add inline style from the Customizer
wp_add_inline_style( 'alux_block_editor_styles', Alux_Custom_CSS::get_customizer_css( 'block-editor' ) );
}
add_action( 'enqueue_block_editor_assets', 'alux_block_editor_styles', 1, 1 );
?>