Advertisement
afsarwebdev

thesmartphone-topslider-cat-order

Sep 3rd, 2022
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.92 KB | None | 0 0
  1. <section class="ic-cat-carousel">
  2. <div class="ic-container">
  3. <div class="ic-top-slider-col" data-repair-url="<?php echo esc_url($settings['repair-page-url']['url']) ?>">
  4. <div class='top-slider-container slider-item'>
  5. <?php foreach ( $model_brands as $model_brand ) :
  6. $brand_thumb = get_term_meta( $model_brand->term_id, 'ic_taxonomy_small_img', true );
  7. $brand_thumb_url = wp_get_attachment_image_url( $brand_thumb, 'full' );
  8. $model_types = get_available_type_of_brand( $model_brand->slug );
  9. // echo "<pre>"; print_r($model_brand->name); echo "</pre>";
  10. ?>
  11. <div class="single-slide">
  12. <div class="slide-img">
  13. <img src="<?php echo esc_url($brand_thumb_url) ?>" alt="<?php echo esc_attr($model_brand->name) ?>">
  14. </div>
  15. <span><?php echo esc_html( $model_brand->name ); ?></span>
  16. <ul>
  17. <?php if("Apple" === $model_brand->name) {
  18. foreach ( $model_types as $model_type_id ):
  19. $model_type = get_term( $model_type_id );
  20. $type_thumb = get_term_meta( $model_type_id, 'ic_taxonomy_img', true );
  21. $type_thumb_url = wp_get_attachment_image_url( $type_thumb, 'full' );
  22. ?>
  23. <li>
  24. <?php
  25. if('iphone' === $model_type->slug) {
  26. ?>
  27. <li class="model-type-filter">
  28. <a href="#" data-brand="<?php echo esc_attr( $model_brand->slug ); ?>" data-type="<?php echo esc_attr( $model_type->slug ); ?>">
  29. <span><img src="<?php echo esc_url($type_thumb_url); ?>"></span>
  30. <span><?php echo esc_html( $model_type->name ); ?></span>
  31. </a>
  32. </li>
  33. <?php
  34. }
  35. ?>
  36. </li>
  37.  
  38. <?php
  39.  
  40. endforeach;
  41.  
  42. foreach ( $model_types as $model_type_id ):
  43. $model_type = get_term( $model_type_id );
  44. $type_thumb = get_term_meta( $model_type_id, 'ic_taxonomy_img', true );
  45. $type_thumb_url = wp_get_attachment_image_url( $type_thumb, 'full' );
  46. ?>
  47. <li>
  48. <?php
  49. if('ipad' === $model_type->slug) {
  50. ?>
  51. <li class="model-type-filter">
  52. <a href="#" data-brand="<?php echo esc_attr( $model_brand->slug ); ?>" data-type="<?php echo esc_attr( $model_type->slug ); ?>">
  53. <span><img src="<?php echo esc_url($type_thumb_url); ?>"></span>
  54. <span><?php echo esc_html( $model_type->name ); ?></span>
  55. </a>
  56. </li>
  57. <?php
  58. }
  59. ?>
  60. </li>
  61.  
  62. <?php
  63.  
  64. endforeach;
  65.  
  66. foreach ( $model_types as $model_type_id ):
  67. $model_type = get_term( $model_type_id );
  68. $type_thumb = get_term_meta( $model_type_id, 'ic_taxonomy_img', true );
  69. $type_thumb_url = wp_get_attachment_image_url( $type_thumb, 'full' );
  70. ?>
  71. <li>
  72. <?php
  73. if('apple-watch' === $model_type->slug) {
  74. ?>
  75. <li class="model-type-filter">
  76. <a href="#" data-brand="<?php echo esc_attr( $model_brand->slug ); ?>" data-type="<?php echo esc_attr( $model_type->slug ); ?>">
  77. <span><img src="<?php echo esc_url($type_thumb_url); ?>"></span>
  78. <span><?php echo esc_html( $model_type->name ); ?></span>
  79. </a>
  80. </li>
  81. <?php
  82. }
  83. ?>
  84. </li>
  85.  
  86. <?php
  87.  
  88. endforeach;
  89.  
  90. foreach ( $model_types as $model_type_id ):
  91. $model_type = get_term( $model_type_id );
  92. $type_thumb = get_term_meta( $model_type_id, 'ic_taxonomy_img', true );
  93. $type_thumb_url = wp_get_attachment_image_url( $type_thumb, 'full' );
  94. ?>
  95. <li>
  96. <?php
  97. if('mackbook' === $model_type->slug) {
  98. ?>
  99. <li class="model-type-filter">
  100. <a href="#" data-brand="<?php echo esc_attr( $model_brand->slug ); ?>" data-type="<?php echo esc_attr( $model_type->slug ); ?>">
  101. <span><img src="<?php echo esc_url($type_thumb_url); ?>"></span>
  102. <span><?php echo esc_html( $model_type->name ); ?></span>
  103. </a>
  104. </li>
  105. <?php
  106. }
  107. ?>
  108. </li>
  109.  
  110. <?php
  111.  
  112. endforeach;
  113. } else {
  114. foreach ( $model_types as $model_type_id ):
  115. $model_type = get_term( $model_type_id );
  116. $type_thumb = get_term_meta( $model_type_id, 'ic_taxonomy_img', true );
  117. $type_thumb_url = wp_get_attachment_image_url( $type_thumb, 'full' );
  118. ?>
  119. <li>
  120. <?php
  121. ?>
  122. <li class="model-type-filter">
  123. <a href="#" data-brand="<?php echo esc_attr( $model_brand->slug ); ?>" data-type="<?php echo esc_attr( $model_type->slug ); ?>">
  124. <span><img src="<?php echo esc_url($type_thumb_url); ?>"></span>
  125. <span><?php echo esc_html( $model_type->name ); ?></span>
  126. </a>
  127. </li>
  128. <?php
  129. ?>
  130. </li>
  131.  
  132. <?php
  133. endforeach;
  134. }
  135. ?>
  136. </ul>
  137. </div>
  138. <?php endforeach; ?>
  139. </div>
  140. </div>
  141.  
  142. <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">
  143. <?php while ( $model_query->have_posts() ): $model_query->the_post();
  144. $model_brand = get_the_terms( get_the_ID(), 'model_brand' );
  145. $model_type = get_the_terms( get_the_ID(), 'model_type' );
  146. $repair_page_url = $settings['repair-page-url']['url'] . '?_brand=' . $model_brand[0]->slug . '&_type=' . $model_type[0]->slug.'&_model='.get_the_ID();
  147. ?>
  148. <div class="col">
  149. <div class="ic-product-item">
  150. <div class="ic-product-thumb">
  151. <?php the_post_thumbnail( 'full', array( 'class' => 'img-fluid' ) ); ?>
  152. </div>
  153. <div class="ic-product-content">
  154. <?php the_title( '<h4 class="ic-product-title">', '</h4>' ) ?>
  155. <a href="<?php echo esc_url( $repair_page_url ) ?>" class="ic-btn-fill">
  156. <?php _e( 'Repareren', 'ic-core' ) ?>
  157. </a>
  158. </div>
  159. </div>
  160. </div>
  161. <?php endwhile;
  162. wp_reset_postdata(); ?>
  163. </div>
  164. </div>
  165. </section>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement