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( 'ascend_main', get_template_directory_uri() . '/assets/js/min/ascend-main-min.js', array( 'jquery', 'hoverIntent', '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
*/
function ascend_ie_support_scripts() {
wp_enqueue_script( 'ascend-html5shiv', get_template_directory_uri() . '/assets/js/vendor/html5shiv.min.js', array(), ASCEND_VERSION, false );
wp_script_add_data( 'ascend-html5shiv', 'conditional', 'lt IE 9' );
wp_enqueue_script( 'ascend-respond', get_template_directory_uri() . '/assets/js/vendor/respond.min.js', array(), ASCEND_VERSION, false );
wp_script_add_data( 'ascend-respond', 'conditional', 'lt IE 9' );
wp_enqueue_style( 'ascend_ie_fallback', get_template_directory_uri() . '/assets/css/ie_fallback.css', false, ASCEND_VERSION );
wp_style_add_data( 'ascend_ie_fallback', 'conditional', 'lt IE' );
}
add_action( 'wp_enqueue_scripts', 'ascend_ie_support_scripts' );