Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <section class="ic-cat-carousel">
- <div class="ic-container">
- <div class="ic-top-slider-col" data-repair-url="<?php echo esc_url($settings['repair-page-url']['url']) ?>">
- <div class='top-slider-container slider-item'>
- <?php foreach ( $model_brands as $model_brand ) :
- $brand_thumb = get_term_meta( $model_brand->term_id, 'ic_taxonomy_small_img', true );
- $brand_thumb_url = wp_get_attachment_image_url( $brand_thumb, 'full' );
- $model_types = get_available_type_of_brand( $model_brand->slug );
- // echo "<pre>"; print_r($model_brand->name); echo "</pre>";
- ?>
- <div class="single-slide">
- <div class="slide-img">
- <img src="<?php echo esc_url($brand_thumb_url) ?>" alt="<?php echo esc_attr($model_brand->name) ?>">
- </div>
- <span><?php echo esc_html( $model_brand->name ); ?></span>
- <ul>
- <?php if("Apple" === $model_brand->name) {
- foreach ( $model_types as $model_type_id ):
- $model_type = get_term( $model_type_id );
- $type_thumb = get_term_meta( $model_type_id, 'ic_taxonomy_img', true );
- $type_thumb_url = wp_get_attachment_image_url( $type_thumb, 'full' );
- ?>
- <li>
- <?php
- if('iphone' === $model_type->slug) {
- ?>
- <li class="model-type-filter">
- <a href="#" data-brand="<?php echo esc_attr( $model_brand->slug ); ?>" data-type="<?php echo esc_attr( $model_type->slug ); ?>">
- <span><img src="<?php echo esc_url($type_thumb_url); ?>"></span>
- <span><?php echo esc_html( $model_type->name ); ?></span>
- </a>
- </li>
- <?php
- }
- ?>
- </li>
- <?php
- endforeach;
- foreach ( $model_types as $model_type_id ):
- $model_type = get_term( $model_type_id );
- $type_thumb = get_term_meta( $model_type_id, 'ic_taxonomy_img', true );
- $type_thumb_url = wp_get_attachment_image_url( $type_thumb, 'full' );
- ?>
- <li>
- <?php
- if('ipad' === $model_type->slug) {
- ?>
- <li class="model-type-filter">
- <a href="#" data-brand="<?php echo esc_attr( $model_brand->slug ); ?>" data-type="<?php echo esc_attr( $model_type->slug ); ?>">
- <span><img src="<?php echo esc_url($type_thumb_url); ?>"></span>
- <span><?php echo esc_html( $model_type->name ); ?></span>
- </a>
- </li>
- <?php
- }
- ?>
- </li>
- <?php
- endforeach;
- foreach ( $model_types as $model_type_id ):
- $model_type = get_term( $model_type_id );
- $type_thumb = get_term_meta( $model_type_id, 'ic_taxonomy_img', true );
- $type_thumb_url = wp_get_attachment_image_url( $type_thumb, 'full' );
- ?>
- <li>
- <?php
- if('apple-watch' === $model_type->slug) {
- ?>
- <li class="model-type-filter">
- <a href="#" data-brand="<?php echo esc_attr( $model_brand->slug ); ?>" data-type="<?php echo esc_attr( $model_type->slug ); ?>">
- <span><img src="<?php echo esc_url($type_thumb_url); ?>"></span>
- <span><?php echo esc_html( $model_type->name ); ?></span>
- </a>
- </li>
- <?php
- }
- ?>
- </li>
- <?php
- endforeach;
- foreach ( $model_types as $model_type_id ):
- $model_type = get_term( $model_type_id );
- $type_thumb = get_term_meta( $model_type_id, 'ic_taxonomy_img', true );
- $type_thumb_url = wp_get_attachment_image_url( $type_thumb, 'full' );
- ?>
- <li>
- <?php
- if('mackbook' === $model_type->slug) {
- ?>
- <li class="model-type-filter">
- <a href="#" data-brand="<?php echo esc_attr( $model_brand->slug ); ?>" data-type="<?php echo esc_attr( $model_type->slug ); ?>">
- <span><img src="<?php echo esc_url($type_thumb_url); ?>"></span>
- <span><?php echo esc_html( $model_type->name ); ?></span>
- </a>
- </li>
- <?php
- }
- ?>
- </li>
- <?php
- endforeach;
- } else {
- foreach ( $model_types as $model_type_id ):
- $model_type = get_term( $model_type_id );
- $type_thumb = get_term_meta( $model_type_id, 'ic_taxonomy_img', true );
- $type_thumb_url = wp_get_attachment_image_url( $type_thumb, 'full' );
- ?>
- <li>
- <?php
- ?>
- <li class="model-type-filter">
- <a href="#" data-brand="<?php echo esc_attr( $model_brand->slug ); ?>" data-type="<?php echo esc_attr( $model_type->slug ); ?>">
- <span><img src="<?php echo esc_url($type_thumb_url); ?>"></span>
- <span><?php echo esc_html( $model_type->name ); ?></span>
- </a>
- </li>
- <?php
- ?>
- </li>
- <?php
- endforeach;
- }
- ?>
- </ul>
- </div>
- <?php endforeach; ?>
- </div>
- </div>
- <div class="row ic-product-items ic-repair-model-wrap row-cols-xl-6 row-cols-lg-6 row-cols-md-5 row-cols-sm-2 row-cols-2">
- <?php while ( $model_query->have_posts() ): $model_query->the_post();
- $model_brand = get_the_terms( get_the_ID(), 'model_brand' );
- $model_type = get_the_terms( get_the_ID(), 'model_type' );
- $repair_page_url = $settings['repair-page-url']['url'] . '?_brand=' . $model_brand[0]->slug . '&_type=' . $model_type[0]->slug.'&_model='.get_the_ID();
- ?>
- <div class="col">
- <div class="ic-product-item">
- <div class="ic-product-thumb">
- <?php the_post_thumbnail( 'full', array( 'class' => 'img-fluid' ) ); ?>
- </div>
- <div class="ic-product-content">
- <?php the_title( '<h4 class="ic-product-title">', '</h4>' ) ?>
- <a href="<?php echo esc_url( $repair_page_url ) ?>" class="ic-btn-fill">
- <?php _e( 'Repareren', 'ic-core' ) ?>
- </a>
- </div>
- </div>
- </div>
- <?php endwhile;
- wp_reset_postdata(); ?>
- </div>
- </div>
- </section>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement