esc_html__( 'Main menu', 'cosmetic-store' ), )); add_theme_support( 'responsive-embeds' ); add_theme_support( 'woocommerce' ); add_theme_support( 'align-wide' ); add_theme_support('title-tag'); add_theme_support('automatic-feed-links'); add_theme_support( 'wp-block-styles' ); add_theme_support('post-thumbnails'); add_theme_support( 'custom-background', array( 'default-color' => 'f3f3f3' )); add_theme_support( 'custom-logo', array( 'height' => 70, 'width' => 70, 'flex-height' => true, 'flex-width' => true, ) ); add_theme_support( 'custom-header', array( 'header-text' => false, 'width' => 1920, 'height' => 100, 'flex-height' => true, 'flex-width' => true, )); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); add_editor_style( array( '/css/editor-style.css' ) ); } add_action( 'after_setup_theme', 'cosmetic_store_after_setup_theme', 999 ); } require get_template_directory() .'/core/includes/main.php'; require get_template_directory() .'/core/includes/tgm.php'; require get_template_directory() . '/core/includes/customizer.php'; load_template( trailingslashit( get_template_directory() ) . '/core/includes/class-upgrade-pro.php' ); /*-----------------------------------------------------------------------------------*/ /* Enqueue theme logo style */ /*-----------------------------------------------------------------------------------*/ function cosmetic_store_logo_resizer() { $cosmetic_store_theme_logo_size_css = ''; $cosmetic_store_logo_resizer = get_theme_mod('cosmetic_store_logo_resizer'); $cosmetic_store_theme_logo_size_css = ' .custom-logo{ height: '.esc_attr($cosmetic_store_logo_resizer).'px !important; width: '.esc_attr($cosmetic_store_logo_resizer).'px !important; } '; wp_add_inline_style( 'cosmetic-store-style',$cosmetic_store_theme_logo_size_css ); } add_action( 'wp_enqueue_scripts', 'cosmetic_store_logo_resizer' ); /*-----------------------------------------------------------------------------------*/ /* Enqueue Global color style */ /*-----------------------------------------------------------------------------------*/ function cosmetic_store_global_color() { $cosmetic_store_theme_color_css = ''; $cosmetic_store_global_color = get_theme_mod('cosmetic_store_global_color'); $cosmetic_store_global_color_2 = get_theme_mod('cosmetic_store_global_color_2'); $cosmetic_store_copyright_bg = get_theme_mod('cosmetic_store_copyright_bg'); $cosmetic_store_theme_color_css = ' a.myacunt-url:hover,.features,.header li.drp_dwn_menu:hover,#main-menu ul.children li a:hover,#main-menu ul.sub-menu li a:hover,p.slider-button a:hover,.slider button.owl-prev i:hover, .slider button.owl-next i:hover,#hot_products .button2,#hot_products .button2::before,#hot_products .button2::after,#hot_products .icon .button1 a.button.product_type_simple.add_to_cart_button.ajax_add_to_cart,.pagination .nav-links a:hover,.pagination .nav-links a:focus,.pagination .nav-links span.current,.cosmetic-store-pagination span.current,.cosmetic-store-pagination span.current:hover,.cosmetic-store-pagination span.current:focus,.cosmetic-store-pagination a span:hover,.cosmetic-store-pagination a span:focus,.comment-respond input#submit,.comment-reply a,.sidebar-widget h4.title,.sidebar-area .tagcloud a,.searchform input[type=submit],.searchform input[type=submit]:hover,.searchform input[type=submit]:focus,.scroll-up a,nav.woocommerce-MyAccount-navigation ul li,.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button,.woocommerce a.added_to_cart{ background: '.esc_attr($cosmetic_store_global_color).'; } a:hover, a:focus,woocommerce ul.products li.product .price,.woocommerce div.product p.price, .woocommerce div.product span.price,#hot_products a.added_to_cart.wc-forward,#hot_products h4 a:hover,#hot_products h5,.slider button.owl-prev i, .slider button.owl-next i,.post-meta i,#main-menu a:hover,#main-menu ul li a:hover,#main-menu li:hover > a,#main-menu a:focus,#main-menu ul li a:focus,#main-menu li.focus > a,#main-menu li:focus > a,#main-menu ul li.current-menu-item > a,#main-menu ul li.current_page_item > a,#main-menu ul li.current-menu-parent > a,#main-menu ul li.current_page_ancestor > a,#main-menu ul li.current-menu-ancestor > a,.top-header p i,.social-links i:hover,.top-info-box a:hover,.blog_inner_box h6{ color: '.esc_attr($cosmetic_store_global_color).'; } .woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, .woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover, .woocommerce a.added_to_cart:hover,nav.woocommerce-MyAccount-navigation ul li:hover,.scroll-up a:hover,.comment-respond input#submit:hover,.comment-reply a:hover,.woocommerce ul.products li.product .onsale, .woocommerce span.onsale,.top-header,footer,p.slider-button a,.blog_inner_box h6{ background: '.esc_attr($cosmetic_store_global_color_2).'; } h3,h5,h6,.woocommerce ul.products li.product .price, .woocommerce div.product p.price, .woocommerce div.product span.price,.features p{ color: '.esc_attr($cosmetic_store_global_color_2).'; } .sidebar-area h4.title{ border-color: '.esc_attr($cosmetic_store_global_color_2).'; } .copyright { background: '.esc_attr($cosmetic_store_copyright_bg).'; } '; wp_add_inline_style( 'cosmetic-store-style',$cosmetic_store_theme_color_css ); wp_add_inline_style( 'cosmetic-store-woocommerce-css',$cosmetic_store_theme_color_css ); } add_action( 'wp_enqueue_scripts', 'cosmetic_store_global_color' ); /*-----------------------------------------------------------------------------------*/ /* Get post comments */ /*-----------------------------------------------------------------------------------*/ if (!function_exists('cosmetic_store_comment')) : /** * Template for comments and pingbacks. * * Used as a callback by wp_list_comments() for displaying the comments. */ function cosmetic_store_comment($comment, $cosmetic_store_args, $depth){ if ('pingback' == $comment->comment_type || 'trackback' == $comment->comment_type) : ?>
  • >
    ', ''); ?>
  • >
    %s', get_comment_author_link() ); ?>
    ', '' ); ?>
    comment_approved) : ?>

    'div-comment', 'depth' => $depth, 'max_depth' => $cosmetic_store_args['max_depth'], 'before' => '
    ', 'after' => '
    ' ) ) ); ?>
    esc_html__('Sidebar','cosmetic-store'), 'id' => 'cosmetic-store-sidebar', 'description' => esc_html__('This sidebar will be shown next to the content.', 'cosmetic-store'), 'before_widget' => '', 'before_title' => '

    ', 'after_title' => '

    ' )); register_sidebar(array( 'name' => esc_html__('Footer sidebar','cosmetic-store'), 'id' => 'cosmetic-store-footer-sidebar', 'description' => esc_html__('This sidebar will be shown next at the bottom of your content.', 'cosmetic-store'), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' )); } add_action( 'widgets_init', 'cosmetic_store_widgets_init' ); } function cosmetic_store_get_categories_select() { $cosmetic_store_teh_cats = get_categories(); $results; $cosmetic_store_count = count($cosmetic_store_teh_cats); for ($i=0; $i < $cosmetic_store_count; $i++) { if (isset($cosmetic_store_teh_cats[$i])) $results[$cosmetic_store_teh_cats[$i]->slug] = $cosmetic_store_teh_cats[$i]->name; else $cosmetic_store_count++; } return $results; } function cosmetic_store_sanitize_select( $input, $setting ) { // Ensure input is a slug $input = sanitize_key( $input ); // Get list of choices from the control // associated with the setting $choices = $setting->manager->get_control( $setting->id )->choices; // If the input is a valid key, return it; // otherwise, return the default return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } /** * Change number or products per row to 3 */ add_filter('loop_shop_columns', 'cosmetic_store_loop_columns', 999); if (!function_exists('cosmetic_store_loop_columns')) { function cosmetic_store_loop_columns() { return 3; // 3 products per row } } //redirect Function cosmetic_store_notice(){ global $pagenow; if ( is_admin() && ('themes.php' == $pagenow) && isset( $_GET['activated'] ) ) { wp_safe_redirect( admin_url("themes.php?page=cosmetic-store-guide-page") ); } } add_action('after_setup_theme', 'cosmetic_store_notice'); ?>