get( 'Version' );
wp_enqueue_style( 'ascend_child', get_stylesheet_uri(), false, $child_version );
}
if ( is_single() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/js/min/bootstrap-min.js', array( 'jquery' ), ASCEND_VERSION, true );
wp_enqueue_script( 'slick', get_template_directory_uri() . '/assets/js/min/slick-min.js', array( 'jquery' ), ASCEND_VERSION, true );
wp_enqueue_script( 'ascend_plugins', get_template_directory_uri() . '/assets/js/min/ascend-plugins-min.js', array( 'jquery', 'hoverIntent' ), ASCEND_VERSION, true );
wp_enqueue_script( 'kadence-sticky', get_template_directory_uri() . '/assets/js/min/ascend_sticky-min.js', array( 'jquery' ), ASCEND_VERSION, true );
wp_enqueue_script( 'ascend_main', get_template_directory_uri() . '/assets/js/min/ascend-main-min.js', array( 'jquery', 'hoverIntent', 'kadence-sticky', 'ascend_plugins', 'masonry' ), ASCEND_VERSION, true );
if ( class_exists( 'woocommerce' ) ) {
if ( is_product() ) {
wp_enqueue_script( 'ascend-wc-add-to-cart-variation', get_template_directory_uri() . '/assets/js/min/kt-add-to-cart-variation-min.js', array( 'jquery' ), ASCEND_VERSION, true );
}
if ( isset( $ascend['product_quantity_input'] ) && 1 == $ascend['product_quantity_input'] ) {
wp_enqueue_script( 'wcqi-js', get_template_directory_uri() . '/assets/js/min/wc-quantity-increment-min.js', array( 'jquery' ), ASCEND_VERSION, true );
}
}
}
add_action( 'wp_enqueue_scripts', 'ascend_scripts', 100 );
/**
* Handles JavaScript detection.
*/
function ascend_javascript_detection() {
echo "\n";
}
add_action( 'wp_head', 'ascend_javascript_detection', 0 );
/**
* Handles Lightbox item translations.
*/
function ascend_lightbox_text() {
$ascend = ascend_get_options();
if ( ! empty( $ascend['lightbox_of_text'] ) ) {
$of_text = $ascend['lightbox_of_text'];
} else {
$of_text = __( 'of', 'ascend' );
}
if ( ! empty( $ascend['lightbox_error_text'] ) ) {
$error_text = $ascend['lightbox_error_text'];
} else {
$error_text = __( 'The image could not be loaded.', 'ascend' );
}
echo '';
}
add_action( 'wp_head', 'ascend_lightbox_text' );
/**
* Add Respond.js for IE8 support of media queries
* Note: IE conditional comments are deprecated in WordPress 6.9.0+ but kept for backward compatibility
*/
function ascend_ie_support_scripts() {
wp_enqueue_script( 'ascend-html5shiv', get_template_directory_uri() . '/assets/js/vendor/html5shiv.min.js', array(), ASCEND_VERSION, false );
// IE conditional comments deprecated in WordPress 6.9.0+ - removed for compatibility
wp_enqueue_script( 'ascend-respond', get_template_directory_uri() . '/assets/js/vendor/respond.min.js', array(), ASCEND_VERSION, false );
// IE conditional comments deprecated in WordPress 6.9.0+ - removed for compatibility
wp_enqueue_style( 'ascend_ie_fallback', get_template_directory_uri() . '/assets/css/ie_fallback.css', false, ASCEND_VERSION );
// IE conditional comments deprecated in WordPress 6.9.0+ - removed for compatibility
}
add_action( 'wp_enqueue_scripts', 'ascend_ie_support_scripts' );