编辑文件:cb-testimonials.php
<?php /** * Homepage testimonials partial — partner quotes from assets/data/testimonials.json. * * @package ClothB2B_Child */ if ( ! defined( 'ABSPATH' ) ) { exit; } $testimonials = function_exists( 'clothb2b_testimonials' ) ? clothb2b_testimonials() : array(); if ( empty( $testimonials ) ) { return; } ?> <section class="cb-section cb-section--alt"> <div class="cb-container"> <div class="cb-section-head"> <span class="cb-eyebrow"><?php esc_html_e( 'Trusted By', 'clothb2b' ); ?></span> <h2 class="cb-section-head__title"><?php esc_html_e( 'What Partners Say', 'clothb2b' ); ?></h2> </div> <div class="cb-testi-grid"> <?php foreach ( $testimonials as $t ) : ?> <figure class="cb-testi"> <blockquote class="cb-testi__quote"><?php echo esc_html( isset( $t['quote'] ) ? $t['quote'] : '' ); ?></blockquote> <figcaption class="cb-testi__author"> <?php if ( ! empty( $t['avatar'] ) ) : ?> <img class="cb-testi__avatar" src="<?php echo esc_url( $t['avatar'] ); ?>" alt="" loading="lazy"> <?php endif; ?> <span> <?php if ( ! empty( $t['author'] ) ) : ?> <span class="cb-testi__name"><?php echo esc_html( $t['author'] ); ?></span> <?php endif; ?> <?php if ( ! empty( $t['role'] ) ) : ?> <span class="cb-testi__role"><?php echo esc_html( $t['role'] ); ?></span> <?php endif; ?> </span> </figcaption> </figure> <?php endforeach; ?> </div> </div> </section>
保存
返回