brand-description.php
1 year ago
brand-thumbnails-description.php
1 year ago
brand-thumbnails.php
1 year ago
brand-thumbnails.php
46 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Show a grid of thumbnails |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/brands/widgets/brand-thumbnails.php. |
| 6 | * |
| 7 | * HOWEVER, on occasion WooCommerce will need to update template files and you |
| 8 | * (the theme developer) will need to copy the new files to your theme to |
| 9 | * maintain compatibility. We try to do this as little as possible, but it does |
| 10 | * happen. When this occurs the version of the template file will be bumped and |
| 11 | * the readme will list any important changes. |
| 12 | * |
| 13 | * @see https://woocommerce.com/document/template-structure/ |
| 14 | * @package WooCommerce\Templates |
| 15 | * @version 9.4.0 |
| 16 | */ |
| 17 | |
| 18 | declare( strict_types = 1); |
| 19 | |
| 20 | $wrapper_class = 'fluid-columns'; |
| 21 | if ( ! $fluid_columns && in_array( $columns, array( 1, 2, 3, 4, 5, 6 ), true ) ) { |
| 22 | $wrapper_class = 'columns-' . $columns; |
| 23 | } |
| 24 | ?> |
| 25 | <ul class="brand-thumbnails <?php echo esc_attr( $wrapper_class ); ?>"> |
| 26 | |
| 27 | <?php |
| 28 | foreach ( array_values( $brands ) as $index => $brand ) : |
| 29 | $class = ''; |
| 30 | if ( 0 === $index || 0 === $index % $columns ) { |
| 31 | $class = 'first'; |
| 32 | } elseif ( 0 === ( $index + 1 ) % $columns ) { |
| 33 | $class = 'last'; |
| 34 | } |
| 35 | ?> |
| 36 | |
| 37 | <li class="<?php echo esc_attr( $class ); ?>"> |
| 38 | <a href="<?php echo esc_url( get_term_link( $brand->slug, 'product_brand' ) ); ?>" title="<?php echo esc_attr( $brand->name ); ?>"> |
| 39 | <?php echo wc_get_brand_thumbnail_image( $brand ); // phpcs:ignore WordPress.Security.EscapeOutput ?> |
| 40 | </a> |
| 41 | </li> |
| 42 | |
| 43 | <?php endforeach; ?> |
| 44 | |
| 45 | </ul> |
| 46 |