feat: release news and store experience updates
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* News card used by the posts page and native post archives.
|
||||
*
|
||||
* @package Fragrance_Trade
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$categories = get_the_category_list( ' · ' );
|
||||
$media_label = sprintf(
|
||||
/* translators: %s: news article title. */
|
||||
__( '阅读%s', 'fragrance-trade' ),
|
||||
get_the_title()
|
||||
);
|
||||
?>
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class( 'news-card' ); ?>>
|
||||
<a class="news-card-media" href="<?php the_permalink(); ?>" aria-label="<?php echo esc_attr( $media_label ); ?>">
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<?php the_post_thumbnail( 'medium_large', array( 'class' => 'img-fluid', 'loading' => 'lazy', 'decoding' => 'async' ) ); ?>
|
||||
<?php else : ?>
|
||||
<img src="<?php echo esc_url( fragrance_trade_asset_uri( 'images/placeholder-news.svg' ) ); ?>" alt="" width="1200" height="675" loading="lazy" decoding="async">
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<div class="news-card-body">
|
||||
<div class="news-meta">
|
||||
<?php if ( $categories ) : ?>
|
||||
<span class="news-categories"><?php echo wp_kses_post( $categories ); ?></span>
|
||||
<?php endif; ?>
|
||||
<time datetime="<?php echo esc_attr( get_the_date( DATE_W3C ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time>
|
||||
</div>
|
||||
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
|
||||
<p><?php echo esc_html( wp_trim_words( get_the_excerpt(), 28 ) ); ?></p>
|
||||
<a class="text-link" href="<?php the_permalink(); ?>"><?php esc_html_e( '阅读全文', 'fragrance-trade' ); ?></a>
|
||||
</div>
|
||||
</article>
|
||||
@@ -20,17 +20,53 @@ $case_query = new WP_Query(
|
||||
<h2><?php esc_html_e( '从案例了解不同项目的实际效果', 'fragrance-trade' ); ?></h2>
|
||||
</div>
|
||||
<?php if ( $case_query->have_posts() ) : ?>
|
||||
<div class="case-grid mt-5">
|
||||
<?php while ( $case_query->have_posts() ) : $case_query->the_post(); ?>
|
||||
<a class="case-card" href="<?php the_permalink(); ?>">
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<?php the_post_thumbnail( 'medium', array( 'class' => 'img-fluid' ) ); ?>
|
||||
<?php else : ?>
|
||||
<img src="<?php echo esc_url( fragrance_trade_asset_uri( 'images/products/placeholder-01.svg' ) ); ?>" alt="<?php the_title_attribute(); ?>" class="img-fluid">
|
||||
<?php endif; ?>
|
||||
<span class="case-card-title"><?php the_title(); ?></span>
|
||||
</a>
|
||||
<?php endwhile; wp_reset_postdata(); ?>
|
||||
<div
|
||||
class="b2b-carousel cases-carousel mt-5"
|
||||
data-carousel
|
||||
data-autoplay="9000"
|
||||
data-page-label="<?php esc_attr_e( '转到第 %d 组', 'fragrance-trade' ); ?>"
|
||||
role="region"
|
||||
aria-roledescription="carousel"
|
||||
aria-label="<?php esc_attr_e( '案例作品', 'fragrance-trade' ); ?>"
|
||||
>
|
||||
<div class="b2b-carousel-viewport">
|
||||
<div class="case-grid b2b-carousel-track">
|
||||
<?php
|
||||
$count = 1;
|
||||
$total_items = $case_query->post_count;
|
||||
while ( $case_query->have_posts() ) :
|
||||
$case_query->the_post();
|
||||
?>
|
||||
<a
|
||||
class="case-card b2b-carousel-slide"
|
||||
href="<?php the_permalink(); ?>"
|
||||
role="group"
|
||||
aria-roledescription="slide"
|
||||
aria-label="<?php echo esc_attr( sprintf( '%1$d / %2$d', $count, $total_items ) ); ?>"
|
||||
>
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<?php the_post_thumbnail( 'large', array( 'class' => 'img-fluid', 'loading' => 'lazy', 'decoding' => 'async' ) ); ?>
|
||||
<?php else : ?>
|
||||
<img src="<?php echo esc_url( fragrance_trade_asset_uri( 'images/products/placeholder-01.svg' ) ); ?>" alt="<?php the_title_attribute(); ?>" class="img-fluid" loading="lazy" decoding="async">
|
||||
<?php endif; ?>
|
||||
<span class="case-card-title"><?php the_title(); ?></span>
|
||||
</a>
|
||||
<?php
|
||||
$count++;
|
||||
endwhile;
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="b2b-carousel-controls" aria-label="<?php esc_attr_e( '案例作品轮播控制', 'fragrance-trade' ); ?>">
|
||||
<button type="button" class="b2b-carousel-arrow b2b-carousel-prev" aria-label="<?php esc_attr_e( '上一组案例', 'fragrance-trade' ); ?>">
|
||||
<span aria-hidden="true">←</span>
|
||||
</button>
|
||||
<div class="b2b-carousel-dots"></div>
|
||||
<button type="button" class="b2b-carousel-arrow b2b-carousel-next" aria-label="<?php esc_attr_e( '下一组案例', 'fragrance-trade' ); ?>">
|
||||
<span aria-hidden="true">→</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center mt-5">
|
||||
<a href="<?php echo esc_url( home_url( '/cases/' ) ); ?>" class="btn btn-b2b-primary"><?php esc_html_e( '查看全部案例', 'fragrance-trade' ); ?></a>
|
||||
|
||||
@@ -9,11 +9,18 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$store_brand = fragrance_trade_get_mod( 'store_brand', __( '康得新 KDX', 'fragrance-trade' ) );
|
||||
$authorization = fragrance_trade_get_mod( 'store_authorization', __( '官方授权至尊服务店', 'fragrance-trade' ) );
|
||||
|
||||
$credentials = array(
|
||||
array(
|
||||
'image' => 'store/kdx-logo.jpg',
|
||||
'title' => __( 'KDX 品牌服务', 'fragrance-trade' ),
|
||||
'description' => __( '门店展示的 KDX 品牌标识与产品服务体系。', 'fragrance-trade' ),
|
||||
'title' => $store_brand,
|
||||
'description' => sprintf(
|
||||
/* translators: %s: store's primary brand. */
|
||||
__( '门店主营 %s 汽车膜产品与施工服务。', 'fragrance-trade' ),
|
||||
$store_brand
|
||||
),
|
||||
'alt' => __( 'KDX 品牌标识', 'fragrance-trade' ),
|
||||
'width' => 1600,
|
||||
'height' => 1472,
|
||||
@@ -21,8 +28,13 @@ $credentials = array(
|
||||
),
|
||||
array(
|
||||
'image' => 'store/authorization.jpg',
|
||||
'title' => __( '授权服务资质', 'fragrance-trade' ),
|
||||
'description' => __( 'KDX 汽车膜授权服务店证书,具体有效期以证书原件为准。', 'fragrance-trade' ),
|
||||
'title' => $authorization,
|
||||
'description' => sprintf(
|
||||
/* translators: 1: brand, 2: authorization level. */
|
||||
__( '%1$s %2$s,具体授权范围与有效期以证书原件为准。', 'fragrance-trade' ),
|
||||
$store_brand,
|
||||
$authorization
|
||||
),
|
||||
'alt' => __( 'KDX 汽车膜授权服务店证书', 'fragrance-trade' ),
|
||||
'width' => 1600,
|
||||
'height' => 1199,
|
||||
|
||||
@@ -22,28 +22,54 @@ if ( ! $service_query->have_posts() ) {
|
||||
<p class="section-eyebrow"><?php esc_html_e( '服务项目', 'fragrance-trade' ); ?></p>
|
||||
<h2><?php esc_html_e( '按车型与需求选择贴膜方案', 'fragrance-trade' ); ?></h2>
|
||||
</div>
|
||||
<div class="capability-grid mt-5">
|
||||
<?php
|
||||
$count = 1;
|
||||
while ( $service_query->have_posts() ) :
|
||||
$service_query->the_post();
|
||||
$image = get_post_meta( get_the_ID(), '_service_image', true );
|
||||
$fallback = 'images/products/placeholder-0' . ( $count < 10 ? $count : 1 ) . '.svg';
|
||||
?>
|
||||
<article class="capability-card">
|
||||
<div class="capability-image"><a href="<?php the_permalink(); ?>"><?php if ( has_post_thumbnail() ) : ?><?php the_post_thumbnail( 'fragrance-capability', array( 'class' => 'img-fluid', 'loading' => 'lazy', 'decoding' => 'async' ) ); ?><?php else : ?><img src="<?php echo esc_url( $image ? $image : fragrance_trade_asset_uri( $fallback ) ); ?>" alt="<?php the_title_attribute(); ?>" class="img-fluid" loading="lazy" decoding="async"><?php endif; ?></a></div>
|
||||
<div class="capability-body">
|
||||
<p class="capability-label"><?php esc_html_e( '贴膜服务', 'fragrance-trade' ); ?></p>
|
||||
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
|
||||
<p><?php echo esc_html( get_the_excerpt() ); ?></p>
|
||||
<a href="<?php echo esc_url( home_url( '/contact/' ) ); ?>" class="btn btn-b2b-outline"><?php esc_html_e( '联系门店', 'fragrance-trade' ); ?></a>
|
||||
</div>
|
||||
</article>
|
||||
<?php
|
||||
$count++;
|
||||
endwhile;
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
<div
|
||||
class="b2b-carousel services-carousel mt-5"
|
||||
data-carousel
|
||||
data-autoplay="9000"
|
||||
data-page-label="<?php esc_attr_e( '转到第 %d 组', 'fragrance-trade' ); ?>"
|
||||
role="region"
|
||||
aria-roledescription="carousel"
|
||||
aria-label="<?php esc_attr_e( '服务项目', 'fragrance-trade' ); ?>"
|
||||
>
|
||||
<div class="b2b-carousel-viewport">
|
||||
<div class="capability-grid b2b-carousel-track">
|
||||
<?php
|
||||
$count = 1;
|
||||
$total_items = $service_query->post_count;
|
||||
while ( $service_query->have_posts() ) :
|
||||
$service_query->the_post();
|
||||
$fallback = 'products/placeholder-0' . ( $count < 10 ? $count : 1 ) . '.svg';
|
||||
?>
|
||||
<article
|
||||
class="capability-card b2b-carousel-slide"
|
||||
role="group"
|
||||
aria-roledescription="slide"
|
||||
aria-label="<?php echo esc_attr( sprintf( '%1$d / %2$d', $count, $total_items ) ); ?>"
|
||||
>
|
||||
<div class="capability-image"><a href="<?php the_permalink(); ?>"><?php echo fragrance_trade_service_card_image( get_the_ID(), $fallback ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></a></div>
|
||||
<div class="capability-body">
|
||||
<p class="capability-label"><?php esc_html_e( '贴膜服务', 'fragrance-trade' ); ?></p>
|
||||
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
|
||||
<p><?php echo esc_html( get_the_excerpt() ); ?></p>
|
||||
<a href="<?php echo esc_url( home_url( '/contact/' ) ); ?>" class="btn btn-b2b-outline"><?php esc_html_e( '联系门店', 'fragrance-trade' ); ?></a>
|
||||
</div>
|
||||
</article>
|
||||
<?php
|
||||
$count++;
|
||||
endwhile;
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="b2b-carousel-controls" aria-label="<?php esc_attr_e( '服务项目轮播控制', 'fragrance-trade' ); ?>">
|
||||
<button type="button" class="b2b-carousel-arrow b2b-carousel-prev" aria-label="<?php esc_attr_e( '上一组服务项目', 'fragrance-trade' ); ?>">
|
||||
<span aria-hidden="true">←</span>
|
||||
</button>
|
||||
<div class="b2b-carousel-dots"></div>
|
||||
<button type="button" class="b2b-carousel-arrow b2b-carousel-next" aria-label="<?php esc_attr_e( '下一组服务项目', 'fragrance-trade' ); ?>">
|
||||
<span aria-hidden="true">→</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center mt-5">
|
||||
<a href="<?php echo esc_url( home_url( '/services/' ) ); ?>" class="btn btn-b2b-primary"><?php esc_html_e( '查看全部服务项目', 'fragrance-trade' ); ?></a>
|
||||
|
||||
Reference in New Issue
Block a user