6 * @subpackage Shop Isle
12 $shop_isle_banners_hide = get_theme_mod( 'shop_isle_banners_hide' );
13 $shop_isle_banners_title = get_theme_mod( 'shop_isle_banners_title' );
15 if ( isset( $shop_isle_banners_hide ) && $shop_isle_banners_hide != 1 ) :
16 echo '<section class="module-small home-banners">';
17 elseif ( is_customize_preview() ) :
18 echo '<section class="module-small home-banners shop_isle_hidden_if_not_customizer">';
21 if ( ( isset( $shop_isle_banners_hide ) && $shop_isle_banners_hide != 1) || is_customize_preview() ) :
23 $shop_isle_banners = get_theme_mod(
24 'shop_isle_banners', json_encode(
27 'image_url' => get_template_directory_uri() . '/assets/images/banner1.jpg',
31 'image_url' => get_template_directory_uri() . '/assets/images/banner2.jpg',
35 'image_url' => get_template_directory_uri() . '/assets/images/banner3.jpg',
42 if ( ! empty( $shop_isle_banners ) ) :
44 $shop_isle_banners_decoded = json_decode( $shop_isle_banners );
46 if ( ! empty( $shop_isle_banners_decoded ) ) :
48 echo '<div class="container">';
50 if ( ! empty( $shop_isle_banners_title ) ) {
51 echo '<div class="row">';
52 echo '<div class="col-sm-6 col-sm-offset-3">';
53 echo '<h2 class="module-title font-alt product-banners-title">' . $shop_isle_banners_title . '</h2>';
57 } elseif ( is_customize_preview() ) {
58 echo '<div class="row">';
59 echo '<div class="col-sm-6 col-sm-offset-3">';
60 echo '<h2 class="module-title font-alt product-banners-title shop_isle_hidden_if_not_customizer"></h2>';
65 echo '<div class="row shop_isle_bannerss_section">';
67 foreach ( $shop_isle_banners_decoded as $shop_isle_banner ) :
69 $image_url = ! empty( $shop_isle_banner->image_url ) ? apply_filters( 'shop_isle_translate_single_string', $shop_isle_banner->image_url, 'Banners section' ) : '';
70 $link = ! empty( $shop_isle_banner->link ) ? apply_filters( 'shop_isle_translate_single_string', $shop_isle_banner->link, 'Banners section' ) : '';
72 if ( ! empty( $image_url ) ) {
74 $shop_isle_alt_image = '';
75 $image_id = function_exists( 'attachment_url_to_postid' ) ? attachment_url_to_postid( $image_url ) : '';
76 if ( ! empty( $image_id ) && $image_id !== 0 ) {
77 $shop_isle_alt_image = 'alt="' . esc_attr( get_post_meta( $image_id, '_wp_attachment_image_alt', true ) ) . '"';
80 echo '<div class="col-sm-4"><div class="content-box mt-0 mb-0"><div class="content-box-image">';
82 if ( ! empty( $link ) ) {
83 echo '<a href="' . esc_url( $link ) . '"><img src="' . esc_url( $image_url ) . '" ' . $shop_isle_alt_image . '></a>';
85 echo '<a><img src="' . esc_url( $image_url ) . '"></a>';
87 echo '</div></div></div>';
100 echo '<hr class="divider-w">';
102 endif; /* END BANNERS */