get( 'Version' ) ); } define( 'AUTO_PARTS_ONLINE_STORE_DEBUG', defined( 'WP_DEBUG' ) && WP_DEBUG === true ); define( 'AUTO_PARTS_ONLINE_STORE_DIR', trailingslashit( get_template_directory() ) ); define( 'AUTO_PARTS_ONLINE_STORE_URL', trailingslashit( get_template_directory_uri() ) ); if ( ! function_exists( 'auto_parts_online_store_support' ) ) : /** * Sets up theme defaults and registers support for various WordPress features. * * @since walker_fse 1.0.0 * * @return void */ function auto_parts_online_store_support() { // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); // Add support for block styles. add_theme_support( 'wp-block-styles' ); add_theme_support( 'post-thumbnails' ); // Enqueue editor styles. add_editor_style( 'style.css' ); // Removing default patterns. remove_theme_support( 'core-block-patterns' ); } endif; add_action( 'after_setup_theme', 'auto_parts_online_store_support' ); /* ---------------------------------------------------------------------------------- Enqueue Styles -----------------------------------------------------------------------------------*/ if ( ! function_exists( 'auto_parts_online_store_styles' ) ) : function auto_parts_online_store_styles() { // registering style for theme wp_enqueue_style( 'auto-parts-online-store-style', get_stylesheet_uri(), array(), AUTO_PARTS_ONLINE_STORE_VERSION ); wp_enqueue_style( 'auto-parts-online-store-blocks-style', get_template_directory_uri() . '/assets/css/blocks.css' ); wp_enqueue_style( 'auto-parts-online-store-aos-style', get_template_directory_uri() . '/assets/css/aos.css' ); if ( is_rtl() ) { wp_enqueue_style( 'auto-parts-online-store-rtl-css', get_template_directory_uri() . '/assets/css/rtl.css', 'rtl_css' ); } // wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'auto-parts-online-store-aos-scripts', get_template_directory_uri() . '/assets/js/aos.js', array(), AUTO_PARTS_ONLINE_STORE_VERSION, true ); wp_enqueue_script( 'auto-parts-online-store-scripts', get_template_directory_uri() . '/assets/js/auto-parts-online-store-scripts.js', array(), AUTO_PARTS_ONLINE_STORE_VERSION, true ); } endif; add_action( 'wp_enqueue_scripts', 'auto_parts_online_store_styles' ); /** * Enqueue scripts for admin area */ function auto_parts_online_store_admin_style() { $hello_notice_current_screen = get_current_screen(); if ( ! empty( $_GET['page'] ) && 'about-auto-parts-online-store' === $_GET['page'] || $hello_notice_current_screen->id === 'themes' || $hello_notice_current_screen->id === 'dashboard' ) { wp_enqueue_style( 'auto-parts-online-store-admin-style', get_template_directory_uri() . '/assets/css/admin-style.css', array(), AUTO_PARTS_ONLINE_STORE_VERSION, 'all' ); wp_enqueue_script( 'auto-parts-online-store-admin-scripts', get_template_directory_uri() . '/assets/js/auto-parts-online-store-admin-scripts.js', array(), AUTO_PARTS_ONLINE_STORE_VERSION, true ); wp_localize_script( 'auto-parts-online-store-admin-scripts', 'auto_parts_online_store_admin_localize', array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'auto_parts_online_store_admin_nonce' ), ) ); wp_enqueue_script( 'auto-parts-online-store-welcome-notice', get_template_directory_uri() . '/inc/admin/js/auto-parts-online-store-welcome-notice.js', array( 'jquery' ), AUTO_PARTS_ONLINE_STORE_VERSION, true ); wp_localize_script( 'auto-parts-online-store-welcome-notice', 'auto_parts_online_store_localize', array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'auto_parts_online_store_welcome_nonce' ), 'redirect_url' => admin_url( 'themes.php?page=_cozy_companions' ), ) ); } } add_action( 'admin_enqueue_scripts', 'auto_parts_online_store_admin_style' ); /** * Enqueue assets scripts for both backend and frontend */ function auto_parts_online_store_block_assets() { wp_enqueue_style( 'auto-parts-online-store-blocks-style', get_template_directory_uri() . '/assets/css/blocks.css' ); } add_action( 'enqueue_block_assets', 'auto_parts_online_store_block_assets' ); /** * Load core file. */ require_once get_template_directory() . '/inc/core/init.php'; /** * Load welcome page file. */ require_once get_template_directory() . '/inc/admin/welcome-notice.php'; function auto_parts_online_store_add_woocommerce_support() { add_theme_support( 'woocommerce' ); } add_action( 'after_setup_theme', 'auto_parts_online_store_add_woocommerce_support' );