100, 'width' => 400, 'flex-width' => true, 'flex-height' => true, ) ); add_theme_support( 'custom-header', array( 'width' => 1920, 'height' => 300, 'flex-height' => true, 'header-text' => false, 'unlink-homepage-logo' => true, ) ); add_theme_support( 'customizer' ); add_theme_support( 'woocommerce' ); add_theme_support( 'custom-background', array( 'default-color' => '', 'default-image' => '', 'default-repeat' => '', 'default-position-x' => '', 'default-attachment' => '', ) ); add_theme_support( 'align-wide' ); } ); //------------------Include Bootstap--------------- function ca_beauty_ecommerce_enqueue_styles() { wp_enqueue_style( 'bootstrap1-ca-beauty-ecommerce', get_template_directory_uri() . '/assets/css/bootstrap.min.css' ); wp_enqueue_script( 'bootstrap-ca-beauty-ecommerce', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array( 'jquery' ), '', true ); wp_enqueue_script( 'custom-js-ca-beauty-ecommerce', get_template_directory_uri() . '/menu/menu.js', array( 'jquery' ), '1.0', true ); wp_enqueue_style( 'custom-css-ca-beauty-ecommerce', get_template_directory_uri() . '/menu/menu.css', array(), '1.0', 'all' ); wp_enqueue_style( 'custom-style1-ca-beauty-ecommerce', get_stylesheet_directory_uri() . '/inc/customizer-button/customizer-custom.css' ); //---------------Color selector file adding-- wp_enqueue_style( 'color-selector-ca-beauty-ecommerce', get_stylesheet_uri() ); require get_parent_theme_file_path( '/inc/color-selector.php' ); wp_add_inline_style( 'color-selector-ca-beauty-ecommerce',$custom_css ); } add_action( 'wp_enqueue_scripts', 'ca_beauty_ecommerce_enqueue_styles' ); //-------------------Loading Fonts Locally----------- function ca_beauty_ecommerce_enqueue_assets() { // Include the file. require_once get_theme_file_path( 'inc/wptt-webfont-loader.php' ); // Load the theme stylesheet. wp_enqueue_style( 'style-ca-beauty-ecommerce', get_stylesheet_directory_uri() . '/style.css', array(), '1.0' ); // Load the webfont. wp_add_inline_style( 'style1-ca-beauty-ecommerce', wptt_get_webfont_styles( 'https://fonts.googleapis.com/css2?family=Literata&display=swap' ) ); } add_action( 'wp_enqueue_scripts', 'ca_beauty_ecommerce_enqueue_assets' ); //-------------------------Header Code-------------------------------- //--------------------My Menu Registration----- // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => esc_html__( 'Primary', 'ca-beauty-ecommerce' ), ) ); //---------------------------My Menu--------------------------------- if( ! function_exists( 'ca_beauty_ecommerce_primary_nagivation' ) ) : /** * Primary Navigation. */ function ca_beauty_ecommerce_primary_nagivation(){ ?> '; echo '
  • ' . esc_html__( 'Click here to add a menu', 'ca-beauty-ecommerce' ) . '
  • '; echo ''; } } endif; //-----------------------Menu function End-------------- function ca_beauty_ecommerce_mytheme_scripts() { wp_enqueue_style('style-main-ca-beauty-ecommerce', get_stylesheet_uri()); } add_action('wp_enqueue_scripts', 'ca_beauty_ecommerce_mytheme_scripts'); //---------------Include Files---------------------- /* Customizer additions. */ require get_template_directory() . '/inc/custom-customizer.php'; require get_template_directory() . '/inc/customizer.php'; //--------------------------Radio Button Customizer Function-------------- /*Radio Button sanitization*/ function ca_beauty_ecommerce_sanitize_choices( $input, $setting ) { global $wp_customize; $control = $wp_customize->get_control( $setting->id ); if ( array_key_exists( $input, $control->choices ) ) { return $input; } else { return $setting->default; } } //-------------------sidebar------------------ function ca_beauty_ecommerce_theme_register_sidebars() { register_sidebar( array( 'name' => __( 'Primary Sidebar', 'ca-beauty-ecommerce' ), 'id' => 'primary-sidebar', 'description' => __( 'Widgets in this area will be shown in the sidebar.', 'ca-beauty-ecommerce' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); } add_action( 'widgets_init', 'ca_beauty_ecommerce_theme_register_sidebars' ); //------------------Credit function--------------- define('CA_BEAUTY_ECOMMERCE_URL','https://cawpthemes.com/'); function ca_beauty_ecommerce_credit_link() { echo esc_html__('Powered by WordPress | By ', 'ca-beauty-ecommerce') . " " . esc_html__('CA WP Themes', 'ca-beauty-ecommerce') . ""; } /** * Fix skip link focus in IE11. * * This does not enqueue the script because it is tiny and because it is only for IE11, * thus it does not warrant having an entire dedicated blocking script being loaded. * * @link https://git.io/vWdr2 */ function ca_beauty_ecommerce_skip_link_focus_fix() { // The following is minified via `terser --compress --mangle -- js/skip-link-focus-fix.js`. ?> __( 'Footer 1 Widget Area', 'ca-beauty-ecommerce' ), 'id' => 'footer_widget_area1', 'description' => __( 'Add widgets here to appear in your footer.', 'ca-beauty-ecommerce' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); register_sidebar( array( 'name' => __( 'Footer 2 Widget Area', 'ca-beauty-ecommerce' ), 'id' => 'footer_widget_area2', 'description' => __( 'Add widgets here to appear in your footer.', 'ca-beauty-ecommerce' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); register_sidebar( array( 'name' => __( 'Footer 3 Widget Area', 'ca-beauty-ecommerce' ), 'id' => 'footer_widget_area3', 'description' => __( 'Add widgets here to appear in your footer.', 'ca-beauty-ecommerce' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); } add_action( 'widgets_init', 'ca_beauty_ecommerce_register_footer_widget_area' ); //-------Extra--------------------- function ca_beauty_ecommerce_mytheme_register_block_styles() { // Register a block style for the heading block wp_register_style( 'ca-beauty-ecommerce-heading-style', get_template_directory_uri() . '/css/blocks.css', array( 'wp-blocks' ), '1.0', 'all' ); register_block_style( 'core/heading', array( 'name' => 'ca-beauty-ecommerce-heading', 'label' => __( 'My Theme Heading', 'ca-beauty-ecommerce' ), 'style_handle' => 'ca-beauty-ecommerce-heading-style', ) ); } add_action( 'init', 'ca_beauty_ecommerce_mytheme_register_block_styles' ); //------Custom Block--------- function ca_beauty_ecommerce_mytheme_register_block_patterns() { if ( function_exists( 'register_block_pattern' ) ) { register_block_pattern( 'ca-beauty-ecommerce/custom-pattern', array( 'title' => __( 'My Custom Pattern', 'ca-beauty-ecommerce' ), 'description' => __( 'A custom block pattern for my theme', 'ca-beauty-ecommerce' ), 'categories' => array( 'text' ), 'content' => '

    This is my custom block pattern

    ', ) ); } } add_action( 'init', 'ca_beauty_ecommerce_mytheme_register_block_patterns' ); function ca_beauty_ecommerce_add_editor_styles() { add_editor_style( 'editor-style.css' ); } add_action( 'admin_init', 'ca_beauty_ecommerce_add_editor_styles' ); //------------------------Comments------------- function ca_beauty_ecommerce_enable_threaded_comments() { if (is_singular() && comments_open() && (get_option('thread_comments') == 1)) { wp_enqueue_script('comment-reply'); } } add_action('wp_enqueue_scripts', 'ca_beauty_ecommerce_enable_threaded_comments'); // ----------------------------Menu navigation keyboard-------------- function ca_beauty_ecommerce_add_tabindex_to_menu_items( $atts, $item, $args, $depth ) { // Add tabindex="0" to the menu item $atts['tabindex'] = '0'; return $atts; } add_filter( 'nav_menu_link_attributes', 'ca_beauty_ecommerce_add_tabindex_to_menu_items', 10, 4 ); //--------------------Define-------------------- define('CA_BEAUTY_ECOMMERCE_PRO_URL',__('https://cawpthemes.com/ca-beauty-ecommerce-premium-wordpress-theme/','ca-beauty-ecommerce')); define('CA_BEAUTY_ECOMMERCE_PRO_SUPPORT',__('https://cawpthemes.com/support/','ca-beauty-ecommerce')); define('CA_BEAUTY_ECOMMERCE_PRO_DEMO',__('https://demo.cawpthemes.com/ca-beauty-ecommerce-pro','ca-beauty-ecommerce')); define('CA_BEAUTY_ECOMMERCE_PRO_DOCUMENTATION',__('https://cawpthemes.com/docs/ca-beauty-ecommerce-free-documentation/','ca-beauty-ecommerce')); define('CA_BEAUTY_ECOMMERCE_FREE_URL',__('https://demo.cawpthemes.com/ca-beauty-ecommerce','ca-beauty-ecommerce'));