'; } else { $html .= ''; } if ($echo) { echo '
' . $html .'
'; } else { return '
' . $html .'
'; } } } // **********************************************************************// // ! Site preloader // **********************************************************************// if ( ! function_exists('etheme_site_preloader') ) { function etheme_site_preloader(){ if ( !etheme_get_option('site_preloader', 0) ) return; if ( !apply_filters('etheme_site_preloader', true) ) return; $img = etheme_get_option( 'preloader_img', '' ); $html = ''; if ( ! empty( $img['url'] ) ){ $html .= 'et-loader'; } else { $html .= ''; } echo '
' . $html .'
'; } } add_action( 'et_after_body', 'etheme_site_preloader', 100, 1); // **********************************************************************// // ! Pagination links // **********************************************************************// if(!function_exists('etheme_pagination')) { function etheme_pagination($args = array()) { $is_rtl = is_rtl(); extract( shortcode_atts( array( 'type' => 'default', 'url' => '', 'pages' => 1, 'paged' => 1, 'range' => 2, 'class' => '', 'before' => '', 'after' => '', 'prev_next' => true, 'prev_text' => '', 'next_text' => '' ), $args ) ); if( $pages != 1 ){ etheme_enqueue_style('pagination', true ); $showitems = ( $range * 2 )+1; $out = ''; if ( $type != 'default' ) { if ( ! $url ) { $url = get_permalink(); } if( $prev_next && $paged > 1 ){ $out .= '
  • '; } for ( $i=1; $i <= $pages; $i++ ){ if ( $pages != 1 &&( ! ( $i >= $paged+$range+1 || $i <= $paged-$range-1 ) || $pages <= $showitems ) ){ if ( $paged == $i ) { $out .= '
  • ' . $i . '
  • '; } else { $out .= '
  • ' . $i . '
  • '; } } } if ( $prev_next && $paged < $pages ){ $out .= '
  • '; } } else { if( $prev_next && $paged > 1 ){ $out .= '
  • '; } for ( $i=1; $i <= $pages; $i++ ){ if ( $pages != 1 &&( ! ( $i >= $paged+$range+1 || $i <= $paged-$range-1 ) || $pages <= $showitems ) ){ if ( $paged == $i ) { $out .= '
  • ' . $i . '
  • '; } else { $out .= '
  • ' . $i . '
  • '; } } } if ( $prev_next && $paged < $pages ){ $out .= '
  • '; } } echo '
    ' . $before . ' ' . $after . '
    '; } } } // **********************************************************************// // ! Function to display comments @see comments.php // **********************************************************************// if(!function_exists('etheme_comments')) { function etheme_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited valid usecase $comment_type = get_comment_type(); if( in_array( $comment_type, array('pingback', 'trackback')) ) : ?>
  • comment_ID, 'rating', true ) ); ?>
  • >

    user_id == get_the_author_meta( 'ID' )) echo ''.esc_html__('Author', 'xstore').''; ?>

    comment_approved == '0'): ?>

    apply_filters('etheme_comment_reply_link_icon', '') . ''.esc_html__('Reply', 'xstore').'', 'depth' => $depth, 'max_depth' => $args['max_depth']) )); ?>
    ' . esc_html__( 'Return to previous page', 'xstore' ) . ''; } } // **********************************************************************// // ! Back to top button // **********************************************************************// if(!function_exists('etheme_btt_button')) { function etheme_btt_button() { get_template_part( 'templates/btt-button' ); return; } } add_action('after_page_wrapper', 'etheme_btt_button', 30); // **********************************************************************// // ! Bordered layout // **********************************************************************// if(!function_exists('etheme_bordered_layout')) { function etheme_bordered_layout() { if(get_query_var('et_main-layout', 'wide') != 'bordered') return; ?>
    false, 'before' => '', 'after' => '', 'wrapper_class' => '', 'class' => '', 'attr' => '', 'echo' => false, 'large' => 4, 'notebook' => 4, 'tablet_land' => 3, 'tablet_portrait' => 2, 'mobile' => 2, 'slider_autoplay' => 'no', 'slider_speed' => 300, 'slider_interval' => 3000, 'slider_stop_on_hover' => false, 'slider_loop' => false, 'slider_space' => false, 'autoheight' => true, 'pagination_type' => 'hide', 'nav_color' => '', 'arrows_bg_color' => '', 'nav_color_hover' => '', 'arrows_bg_color_hover' => '', 'default_color' => '#e6e6e6', 'active_color' => '#b3a089', 'hide_fo' => '', 'hide_buttons' => false, 'navigation_type' => 'arrow', 'navigation_position_style' => 'arrows-hover', 'navigation_style' => '', 'navigation_position'=> 'middle', 'hide_buttons_for' => '', 'size' => 'woocommerce_thumbnail', 'per_move' => 1, // ! blog args 'slide_view' => '', 'hide_img' => false, 'blog_align' => '', 'blog_hover' => 'zoom', // ! Products args 'block_id' => false, 'style' => 'default', 'product_view' => '', 'product_view_color' => '', 'no_spacing' => '', 'shop_link' => false, 'slider_type' => false, 'from_first' => '', 'widget' => false, 'wrap_widget_items_in_div' => false, 'elementor' => false, 'is_preview' => false ); // backward compatibility to woocommerce <= 3.8.0 because in newest versions few sizes were removed if ( isset($atts['size'] ) ) { $atts['size'] = str_replace( array( 'shop_thumbnail', 'shop_catalog', 'shop_single' ), array( 'woocommerce_gallery_thumbnail', 'woocommerce_thumbnail', 'woocommerce_single' ), $atts['size'] ); } extract( shortcode_atts( $slider_atts, $atts ) ); add_filter('et_view-mode-grid', '__return_true'); // fix for variation galleries if ( function_exists('remove_et_variation_gallery_filter')) remove_et_variation_gallery_filter(''); $box_id = rand( 1000, 10000 ); // $variable_products_detach = etheme_get_option('variable_products_detach', false); // if ( $variable_products_detach ) { // $variable_products_no_parent = etheme_get_option('variation_product_parent_hidden', true); // $show_attributes = etheme_get_option('variation_product_name_attributes', true); // if ( $show_attributes ) { // add_filter( 'woocommerce_product_variation_title_include_attributes', '__return_true' ); // } // if ( $args['post_type'] == 'product' ) { // $args['post_type'] = array('product', 'product_variation'); // } // elseif (is_array($args['post_type']) && in_array('product', $args['post_type'])) { // $args['post_type'] = array('product', 'product_variation'); // } // $posts_not_in = etheme_product_variations_excluded(); // if ( array_key_exists('post__not_in', $args) ) { // $args['post__not_in'] = array_unique( array_merge((array)$args['post__not_in'], $posts_not_in) ); // } // else { // $args['post__not_in'] = array_unique( $posts_not_in ); // } // // hides all variable products // if ( $variable_products_no_parent ) { // $args['tax_query'][] = array( // array( // 'taxonomy' => 'product_type', // 'field' => 'slug', // 'terms' => 'variable', // 'operator' => 'NOT IN', // ), // ); // } // } $multislides = new WP_Query( $args ); $loop = $slide_class = $html = ''; if ( $slider_stop_on_hover ) $class .= ' stop-on-hover'; if ( $type == 'post' ) { global $et_loop; $et_loop['slider'] = true; $et_loop['blog_layout'] = 'default'; $et_loop['size'] = $size; $et_loop['hide_img'] = $hide_img; $et_loop['blog_hover'] = $blog_hover; $et_loop['slide_view'] = $slide_view; $et_loop['blog_align'] = $blog_align; $class .= ' posts-slider'; } else { if( ! class_exists( 'Woocommerce' ) ) return; global $woocommerce_loop; if ( !isset($woocommerce_loop['size']) || empty( $woocommerce_loop['size'] ) ) $woocommerce_loop['size'] = $size; if( ! $slider_type ) { $woocommerce_loop['lazy-load'] = false; $woocommerce_loop['style'] = $style; } if( !empty($woocommerce_loop['product_view'])) { $product_view = $woocommerce_loop['product_view']; } else { $product_view = etheme_get_option('product_view', 'disable'); } if( !empty($woocommerce_loop['custom_template'])) { $custom_template = $woocommerce_loop['custom_template']; } else { $custom_template = etheme_get_custom_product_template(); } $block = ''; $class .= ' products-slider'; if ( !empty($woocommerce_loop['hover_shadow']) && $woocommerce_loop['hover_shadow'] ) $class .= ' products-hover-shadow'; $slide_class .= ' slide-item product-slide '; $slide_class .= $slider_type . '-slide'; if( $no_spacing == 'yes' ) $slide_class .= ' item-no-space'; if( $block_id && $block_id != '' && etheme_static_block( $block_id, false ) != '' ) { ob_start(); echo '
    '; etheme_static_block($block_id, true); echo '
    '; $block = ob_get_contents(); ob_end_clean(); } } if ( $multislides->have_posts() ) { if ( $type == 'post' ) { add_filter( 'excerpt_length', 'etheme_excerpt_length_sliders', 1000 ); } if ( $type == 'product' ) { $ajax = isset($woocommerce_loop['doing_ajax']) && $woocommerce_loop['doing_ajax']; if ( !$ajax ) { etheme_enqueue_style( 'woocommerce' ); etheme_enqueue_style( 'woocommerce-archive' ); if ( get_query_var( 'et_is-swatches', false ) ) { etheme_enqueue_style( "swatches-style" ); } if ( ! in_array( $product_view, array( 'disable', 'custom' ) ) ) { etheme_enqueue_style( 'product-view-' . $product_view ); } if ( $product_view == 'custom' || ! empty( $woocommerce_loop['custom_template'] ) ) { etheme_enqueue_style( 'content-product-custom' ); } // if ( get_query_var('et_is-quick-view', false) ) { // etheme_enqueue_style( "quick-view" ); // if ( get_query_var('et_is-quick-view-type', 'popup') == 'off_canvas' ) { // etheme_enqueue_style( "off-canvas" ); // } // } } } $autoheight = ( $autoheight ) ? 'data-autoheight="1"' : ''; $lines = ( $pagination_type == 'lines' ) ? 'swiper-pagination-lines' : ''; $slider_speed = ( $slider_speed ) ? 'data-speed="' . $slider_speed . '"' : ''; if ( $slider_autoplay ) $slider_autoplay = $slider_interval; if ( $autoheight ) $autoheight = 'data-autoheight="1"'; if ( $multislides->post_count <= $large ) { $slider_loop = false; } if ( $slider_loop ) $loop = ' data-loop="true"'; $selectors = array(); $selectors['slider'] = '.slider-'.$box_id; $selectors['pagination'] = $selectors['slider'] . ' .swiper-pagination-bullet'; $selectors['pagination_active'] = $selectors['pagination'] . '-active,' . $selectors['pagination'] . ':hover'; $selectors['navigation'] = $selectors['slider'] . ' ~ .swiper-button-prev,' . $selectors['slider'] . ' ~ .swiper-button-next'; $selectors['navigation_active'] = $selectors['slider'] . ' ~ .swiper-button-prev:hover,' . $selectors['slider'] . ' ~ .swiper-button-next:hover'; $output_css = array( 'pagination' => array(), 'navigation' => array() ); $wrapper_class .= ' ' . $navigation_position; $wrapper_class .= ' ' . $navigation_position_style; $html .= '
    '; $html .= $before; $html .= ( $title ) ? apply_filters('etheme_slider_title', '

    ' . $title . '

    ', $title) : ''; if ( $type == 'product' && $product_view == 'custom' && $custom_template != '' ) { $class .= ' products-with-custom-template products-template-'.$custom_template; $attr .= ' data-post-id="'.$custom_template.'"'; } // bug in mini-cart products // if ( $widget ) { // $class .= ' swiper-container-multirow'; // } $elementor_nospacing = ''; if ( true == $elementor && 'yes' == $no_spacing ) { $elementor_nospacing = 'data-space="0"'; } if ( $slider_space && !$elementor_nospacing) { $elementor_nospacing .= ' data-space="'.$slider_space.'"'; } $html .=' '; if ( ! $hide_buttons || ( $hide_buttons && $hide_buttons_for != '' ) ) { $navigation_class = ''; if ( $elementor == true ) { $navigation_class .= ' et-swiper-elementor-nav'; } if ( $hide_buttons_for == 'desktop' ) $navigation_class .= ' dt-hide'; elseif ( $hide_buttons_for == 'mobile' ) $navigation_class .= ' mob-hide'; $navigation_class_left = 'swiper-custom-left' . ' ' . $navigation_class; $navigation_class_right = 'swiper-custom-right' . ' ' . $navigation_class; $navigation_class_left .= ' type-' . $navigation_type . ' ' . $navigation_style; $navigation_class_right .= ' type-' . $navigation_type . ' ' . $navigation_style; if ( $navigation_position == 'bottom' ) $html .= '
    '; if ( false == $elementor || ( true == $elementor && 'middle' == $navigation_position || 'middle-inside' == $navigation_position ) ) { $html .= '
    '; } if ( $navigation_position == 'bottom' ) $html .= '
    '; if ( !empty($arrows_bg_color) ) { $output_css['navigation'][] = 'background-color: ' .$arrows_bg_color; } if ( !empty($nav_color) ) { $output_css['navigation'][] = 'color: ' .$nav_color; } if ( !empty($nav_color_hover) ) { $output_css['navigation_hover'][] = 'color: ' .$nav_color_hover; } if ( !empty($arrows_bg_color_hover) ) { $output_css['navigation_hover'][] = 'opacity: 1; background-color: ' .$arrows_bg_color_hover; } if ( count($output_css['navigation']) ) { $output_css['navigation'] = $selectors['navigation'] . '{' . implode(';', $output_css['navigation']) . '}'; if ( $is_preview ) { $html .= ''; } else { wp_add_inline_style( 'xstore-inline-css', $output_css['navigation'] ); } } // wp_add_inline_style( 'xstore-inline-css', // '.slider-'.$box_id.' .swiper-button-prev, .slider-'.$box_id . ' .swiper-button-next {background-color:'.$arrows_bg_color.'; color: '. $nav_color .';}' } $html .= $after; $html .= '
    '; if ( $type == 'post' ) { remove_filter( 'excerpt_length', 'etheme_excerpt_length_sliders', 1000 ); } }; // end fix for variation galleries if (function_exists('add_et_variation_gallery_filter')) add_et_variation_gallery_filter(''); remove_filter('et_view-mode-grid', '__return_true'); remove_filter( 'woocommerce_product_variation_title_include_attributes', '__return_true' ); if ( $type == 'post' ) { unset( $et_loop ); wp_reset_postdata(); } else { wp_reset_query(); unset( $woocommerce_loop['lazy-load'] ); unset( $woocommerce_loop['style'] ); } if ( $is_preview ) $html .= ''; if ( $echo ) { echo $html; // All data escaped } else { return $html; } } }