8889841c 200, 'woocommerce_thumbnail' => 768, )); add_theme_support( 'post-thumbnails' ); add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); remove_theme_support( 'widgets-block-editor' ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); /** * Support Gutenberg. * * @since 0.2.6 */ add_theme_support( 'align-wide' ); /** * Add editor style support. */ add_theme_support( 'editor-styles' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'hb-primary-navigation' => esc_html__( 'Primary Navigation', 'skyhaus' ), 'hb-menu-mobile' => esc_html__( 'Mobile Navigation', 'skyhaus' ), 'hb-menu-navigation1' => esc_html__( 'Navigation 1', 'skyhaus' ), 'hb-menu-navigation2' => esc_html__( 'Navigation 2', 'skyhaus' ), 'hb-category-button' => esc_html__( 'Category Button', 'skyhaus' ), ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); } endif; // skyhaus_setup add_action( 'after_setup_theme', 'skyhaus_setup' ); /** * Enqueue scripts and styles. */ if (!function_exists("skyhaus_scripts")) { function skyhaus_scripts() { //STYLESHEETS wp_enqueue_style( "font-awesome5", get_template_directory_uri()."/assets/vendor/font-awesome/all.min.css", array(), "5.15.4" ); wp_enqueue_style( "bootstrap", get_template_directory_uri()."/assets/vendor/bootstrap/bootstrap.min.css", array(), "5.0.2" ); wp_enqueue_style( "skyhaus-styles", get_template_directory_uri()."/assets/css/styles.css" ); wp_enqueue_style( "skyhaus-style", get_stylesheet_uri() ); wp_enqueue_style( "skyhaus-style-custom", get_template_directory_uri()."/assets/css/skyhaus-style.css" ); wp_enqueue_style( "skyhaus-gutenberg-frontend", get_template_directory_uri()."/inc/gutenberg/assets/gutenberg-frontend.css" ); // WooCommerce if ( class_exists( "WooCommerce" ) ) { wp_enqueue_style( "skyhaus-woocommerce", get_template_directory_uri()."/assets/css/compatibility/woocommerce.css" ); } wp_enqueue_style( "select2", get_template_directory_uri()."/assets/vendor/select2/select2.min.css" ); // BuddyPress/Youzify if ( class_exists( "BuddyPress" ) || class_exists('Youzify') ) { wp_enqueue_style( "buddypress-youzify", get_template_directory_uri()."/assets/css/compatibility/buddypress-youzify.css" ); } // The Events Calendar if ( class_exists( "Tribe__Template" )) { wp_enqueue_style( "tribe-events", get_template_directory_uri()."/assets/css/compatibility/tribe-events.css" ); } //SCRIPTS wp_enqueue_script( "classie", get_template_directory_uri() . "/assets/vendor/classie/classie.js", array("jquery"), "1.0", true ); wp_enqueue_script( "jquery-sticky", get_template_directory_uri() . "/assets/vendor/jquery-sticky/jquery.sticky.js", array("jquery"), "1.0.0", true ); wp_enqueue_script( 'scrollIt', get_template_directory_uri() . '/assets/vendor/jquery-sticky/scrollIt.min.js', array('jquery'), '1.0.0', true ); wp_enqueue_script( "bootstrap", get_template_directory_uri() . "/assets/vendor/bootstrap/bootstrap.min.js", array("jquery"), "3.3.1", true ); wp_enqueue_script( "select2", get_template_directory_uri() . "/assets/vendor/select2/select2.min.js", array("jquery"), "4.1.0-rc.0", true ); // WooCommerce if ( class_exists( "WooCommerce" ) ) { wp_enqueue_script( "custom-woocommerce", get_template_directory_uri() . "/assets/js/compatibility/custom-woocommerce.js", array("jquery"), "1.0.0", true ); wp_enqueue_script( "jquery-cookie", get_template_directory_uri() . "/assets/vendor/jquery-cookie/jquery.cookie.min.js", array("jquery"), "1.2", true ); wp_enqueue_script( "jquery-matchheight", get_template_directory_uri() . "/assets/vendor/jquery-match-height/jquery.matchHeight-min.js", array("jquery"), "0.7.2", true ); } // Custom JS wp_enqueue_script( "skyhaus-custom", get_template_directory_uri() . "/assets/js/custom.js", array("jquery"), "1.0.0", true ); if ( is_singular() && comments_open() && get_option( "thread_comments" ) ) { wp_enqueue_script( "comment-reply" ); } } add_action( "wp_enqueue_scripts", "skyhaus_scripts" ); } /** * Enqueue Editor styles. */ function skyhaus_add_editor_styles() { add_editor_style( 'assets/css/custom-editor-style.css' ); } add_action( 'admin_init', 'skyhaus_add_editor_styles' ); /** * Enqueue scripts and styles for admin dashboard. */ if (!function_exists('skyhaus_enqueue_admin_scripts')) { function skyhaus_enqueue_admin_scripts( $hook ) { wp_enqueue_style( 'skyhaus-admin-style', get_template_directory_uri().'/assets/css/admin-style.css' ); } add_action('admin_enqueue_scripts', 'skyhaus_enqueue_admin_scripts'); } function skyhaus_get_all_header_parts() { $header_parts = array( 'navigation' => esc_html__( 'Navigation', 'skyhaus' ), 'cart' => esc_html__( 'Cart', 'skyhaus' ), 'logo' => esc_html__( 'Logo', 'skyhaus' ), 'search-form' => esc_html__( 'Search Form', 'skyhaus' ), 'lang-curr-dropdown' => esc_html__( 'Language & Currency Dropdown', 'skyhaus' ), 'category-menu' => esc_html__( 'Category Menu', 'skyhaus' ) ); return $header_parts; } /* ========= LOAD ===================================== */ // Include the TGM_Plugin_Activation class. require get_template_directory().'/inc/tgm/include_plugins.php'; // Theme functions require get_template_directory() . '/inc/functions-theme.php'; // WooCommerce functions if (class_exists( 'WooCommerce' )) { require get_template_directory() . '/inc/functions-woocommerce.php'; } // Gutenberg functions require_once get_template_directory() . '/inc/gutenberg/functions.php'; /* ========= RESIZE IMAGES ===================================== */ add_image_size( 'skyhaus_blog_single', 1400, 650, true ); /* ========= SEARCH FOR POSTS ONLY ===================================== */ function skyhaus_search_filter($query) { if ($query->is_search && !isset($_GET['post_type'])) { $query->set('post_type', 'post'); } return $query; } if( !is_admin() ){ add_filter('pre_get_posts','skyhaus_search_filter'); } // KSES ALLOWED HTML if (!function_exists('skyhaus_kses_allowed_html')) { function skyhaus_kses_allowed_html($tags, $context) { switch($context) { case 'link': $tags = array( 'a' => array( 'href' => array(), 'class' => array(), 'title' => array(), 'target' => array(), 'rel' => array(), 'data-commentid' => array(), 'data-postid' => array(), 'data-belowelement' => array(), 'data-respondelement' => array(), 'data-replyto' => array(), 'aria-label' => array(), ), 'img' => array( 'src' => array(), 'alt' => array(), 'style' => array(), 'height' => array(), 'width' => array(), ), ); return $tags; break; case 'icon': $tags = array( 'i' => array( 'class' => array(), ), ); return $tags; break; default: return $tags; } } add_filter( 'wp_kses_allowed_html', 'skyhaus_kses_allowed_html', 10, 2); } /* search */ if (!function_exists('skyhaus_search_form_ajax_fetch')) { add_action( 'wp_footer', 'skyhaus_search_form_ajax_fetch' ); function skyhaus_search_form_ajax_fetch() { ?> 'product', 'post_status' => 'publish', 'post_per_page' => get_option('posts_per_page'), 'tax_query' => array( array( 'taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => esc_attr($_POST['category_slug']), ), ), 's' => esc_attr( $_POST['keyword']) ) ); }else{ $the_query = new WP_Query( array( 'post_type'=> 'product', 'post_per_page' => get_option('posts_per_page'), 's' => esc_attr( $_POST['keyword']) ) ); } if( $the_query->have_posts() ) : ?>