feat: release B2B Trade theme 2.1.0

This commit is contained in:
WorkBuddy
2026-07-24 22:25:29 +08:00
parent 13a35c7ec7
commit 4f070d4677
64 changed files with 1769 additions and 1762 deletions
+4
View File
@@ -6,6 +6,10 @@
*
* @param array $items Array of ['label' => string, 'url' => string|null].
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( empty( $args['items'] ) || ! is_array( $args['items'] ) ) {
return;
+4
View File
@@ -1,5 +1,9 @@
<?php
/** Empty-loop content. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<section class="no-results not-found text-center py-5">
<h1 class="page-title"><?php esc_html_e( '未找到内容', 'fragrance-trade' ); ?></h1>
+4
View File
@@ -1,3 +1,7 @@
<?php
/** Page content. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
get_template_part( 'template-parts/content' );
+4
View File
@@ -1,5 +1,9 @@
<?php
/** Generic loop content. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'fragrance-entry' ); ?>>
<header class="entry-header mb-3">
+9 -4
View File
@@ -1,18 +1,23 @@
<?php
/** Case teaser on the homepage. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$case_query = new WP_Query(
array(
'post_type' => 'case',
'posts_per_page' => 6,
'post_status' => 'publish',
'no_found_rows' => true,
)
);
?>
<section id="cases" class="b2b-section cases-section">
<div class="container">
<div class="section-heading text-center mx-auto">
<p class="section-eyebrow"><?php esc_html_e( '施工案例', 'fragrance-trade' ); ?></p>
<h2><?php esc_html_e( '为车主完成的贴膜施工', 'fragrance-trade' ); ?></h2>
<p class="section-eyebrow"><?php esc_html_e( '施工记录', 'fragrance-trade' ); ?></p>
<h2><?php esc_html_e( '从案例了解不同项目的实际效果', 'fragrance-trade' ); ?></h2>
</div>
<?php if ( $case_query->have_posts() ) : ?>
<div class="case-grid mt-5">
@@ -21,7 +26,7 @@ $case_query = new WP_Query(
<?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( 'products/placeholder-01.svg' ) ); ?>" alt="<?php the_title_attribute(); ?>" class="img-fluid">
<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>
@@ -31,7 +36,7 @@ $case_query = new WP_Query(
<a href="<?php echo esc_url( home_url( '/cases/' ) ); ?>" class="btn btn-b2b-primary"><?php esc_html_e( '查看全部案例', 'fragrance-trade' ); ?></a>
</div>
<?php else : ?>
<p class="text-center mt-4 mb-0"><?php esc_html_e( '案例即将上线,敬请期待。', 'fragrance-trade' ); ?></p>
<p class="text-center mt-4 mb-0"><?php esc_html_e( '案例内容正在整理中。', 'fragrance-trade' ); ?></p>
<?php endif; ?>
</div>
</section>
+7 -3
View File
@@ -1,10 +1,14 @@
<?php
/** Booking call-to-action band on the homepage. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<section class="b2b-section cta-section">
<div class="container text-center">
<h2><?php esc_html_e( '准备好为爱车贴膜了吗', 'fragrance-trade' ); ?></h2>
<p class="section-lead mx-auto"><?php esc_html_e( '留下您的车型与需求,我们会尽快与您联系,确认到店施工时间。', 'fragrance-trade' ); ?></p>
<a href="<?php echo esc_url( home_url( '/contact/' ) ); ?>" class="btn btn-b2b-primary btn-lg"><?php esc_html_e( '立即预约', 'fragrance-trade' ); ?></a>
<h2><?php esc_html_e( '想先了解适合哪种贴膜方案', 'fragrance-trade' ); ?></h2>
<p class="section-lead mx-auto"><?php esc_html_e( '告诉我们车型、使用场景、关注的问题和预算范围,门店会结合实际情况说明可选项目与到店安排。', 'fragrance-trade' ); ?></p>
<a href="<?php echo esc_url( home_url( '/contact/' ) ); ?>" class="btn btn-b2b-primary btn-lg"><?php esc_html_e( '联系门店', 'fragrance-trade' ); ?></a>
</div>
</section>
+11 -2
View File
@@ -1,4 +1,13 @@
<?php /** Documentation support. @package Fragrance_Trade */ if ( ! fragrance_trade_show_section( 'b2b_show_documents' ) ) { return; } ?>
<?php
/** Documentation support. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! fragrance_trade_show_section( 'b2b_show_documents' ) ) {
return;
}
?>
<section id="documents" class="b2b-section documents-section">
<div class="container"><div class="row g-5"><div class="col-lg-5"><p class="section-eyebrow"><?php esc_html_e( '文档支持', 'fragrance-trade' ); ?></p><h2><?php echo esc_html( fragrance_trade_get_mod( 'b2b_documents_title' ) ); ?></h2><p class="section-lead"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_documents_text' ) ); ?></p></div><div class="col-lg-7"><div class="document-grid"><?php for ( $index = 1; $index <= 4; $index++ ) : ?><article><span aria-hidden="true">✓</span><div><h3><?php echo esc_html( fragrance_trade_get_mod( 'b2b_document_' . $index . '_title' ) ); ?></h3><p><?php echo esc_html( fragrance_trade_get_mod( 'b2b_document_' . $index . '_text' ) ); ?></p></div></article><?php endfor; ?></div></div></div></div>
<div class="container"><div class="row g-5"><div class="col-lg-5"><p class="section-eyebrow"><?php esc_html_e( '交付说明', 'fragrance-trade' ); ?></p><h2><?php echo esc_html( fragrance_trade_get_mod( 'b2b_documents_title' ) ); ?></h2><p class="section-lead"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_documents_text' ) ); ?></p></div><div class="col-lg-7"><div class="document-grid"><?php for ( $index = 1; $index <= 4; $index++ ) : ?><article><span aria-hidden="true">✓</span><div><h3><?php echo esc_html( fragrance_trade_get_mod( 'b2b_document_' . $index . '_title' ) ); ?></h3><p><?php echo esc_html( fragrance_trade_get_mod( 'b2b_document_' . $index . '_text' ) ); ?></p></div></article><?php endfor; ?></div></div></div></div>
</section>
+4
View File
@@ -1,5 +1,9 @@
<?php
/** Factory proof section. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$factory_fallbacks = array( 'placeholder-factory-01.svg', 'placeholder-factory-02.svg', 'placeholder-factory-03.svg', 'placeholder-factory-04.svg' );
?>
<section id="factory" class="b2b-section factory-proof">
+11 -2
View File
@@ -1,2 +1,11 @@
<?php /** B2B FAQ. @package Fragrance_Trade */ if ( ! fragrance_trade_show_section( 'b2b_show_faq' ) ) { return; } ?>
<section id="faqs" class="b2b-section faq-section"><div class="container"><div class="row g-5"><div class="col-lg-4"><p class="section-eyebrow"><?php esc_html_e( '常见问题', 'fragrance-trade' ); ?></p><h2><?php echo esc_html( fragrance_trade_get_mod( 'b2b_faq_title' ) ); ?></h2><p><?php esc_html_e( '服务内容、价格和工期以到店确认为准。如需具体答复请使用预约表单。', 'fragrance-trade' ); ?></p></div><div class="col-lg-8"><div class="accordion" id="b2b-faq-accordion"><?php for ( $index = 1; $index <= 8; $index++ ) : $first = 1 === $index; ?><div class="accordion-item"><h3 class="accordion-header" id="b2b-faq-heading-<?php echo esc_attr( $index ); ?>"><button class="accordion-button<?php echo $first ? '' : ' collapsed'; ?>" type="button" data-bs-toggle="collapse" data-bs-target="#b2b-faq-panel-<?php echo esc_attr( $index ); ?>" aria-expanded="<?php echo $first ? 'true' : 'false'; ?>" aria-controls="b2b-faq-panel-<?php echo esc_attr( $index ); ?>"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_faq_' . $index . '_question' ) ); ?></button></h3><div id="b2b-faq-panel-<?php echo esc_attr( $index ); ?>" class="accordion-collapse collapse<?php echo $first ? ' show' : ''; ?>" aria-labelledby="b2b-faq-heading-<?php echo esc_attr( $index ); ?>" data-bs-parent="#b2b-faq-accordion"><div class="accordion-body"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_faq_' . $index . '_answer' ) ); ?></div></div></div><?php endfor; ?></div></div></div></div></section>
<?php
/** B2B FAQ. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! fragrance_trade_show_section( 'b2b_show_faq' ) ) {
return;
}
?>
<section id="faqs" class="b2b-section faq-section"><div class="container"><div class="row g-5"><div class="col-lg-4"><p class="section-eyebrow"><?php esc_html_e( '常见问题', 'fragrance-trade' ); ?></p><h2><?php echo esc_html( fragrance_trade_get_mod( 'b2b_faq_title' ) ); ?></h2><p><?php esc_html_e( '以下内容用于帮助您提前了解选择和施工注意事项。具体项目、价格、工期与质保,请以门店最终确认为准。', 'fragrance-trade' ); ?></p></div><div class="col-lg-8"><div class="accordion" id="b2b-faq-accordion"><?php for ( $index = 1; $index <= 8; $index++ ) : $first = 1 === $index; ?><div class="accordion-item"><h3 class="accordion-header" id="b2b-faq-heading-<?php echo esc_attr( $index ); ?>"><button class="accordion-button<?php echo $first ? '' : ' collapsed'; ?>" type="button" data-bs-toggle="collapse" data-bs-target="#b2b-faq-panel-<?php echo esc_attr( $index ); ?>" aria-expanded="<?php echo $first ? 'true' : 'false'; ?>" aria-controls="b2b-faq-panel-<?php echo esc_attr( $index ); ?>"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_faq_' . $index . '_question' ) ); ?></button></h3><div id="b2b-faq-panel-<?php echo esc_attr( $index ); ?>" class="accordion-collapse collapse<?php echo $first ? ' show' : ''; ?>" aria-labelledby="b2b-faq-heading-<?php echo esc_attr( $index ); ?>" data-bs-parent="#b2b-faq-accordion"><div class="accordion-body"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_faq_' . $index . '_answer' ) ); ?></div></div></div><?php endfor; ?></div></div></div></div></section>
+10 -6
View File
@@ -1,5 +1,9 @@
<?php
/** Hero — minimalist luxury. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$title = fragrance_trade_get_mod( 'b2b_hero_title' );
?>
<section id="intro" class="b2b-hero">
@@ -10,13 +14,13 @@ $title = fragrance_trade_get_mod( 'b2b_hero_title' );
<h1><?php echo esc_html( $title ); ?></h1>
<p class="b2b-hero-lead"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_hero_text' ) ); ?></p>
<div class="d-flex flex-wrap gap-3 mt-4">
<a class="btn btn-b2b-primary btn-lg" href="<?php echo esc_url( fragrance_trade_get_mod( 'b2b_hero_primary_url' ) ); ?>"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_hero_primary_label' ) ); ?></a>
<a class="btn btn-b2b-outline btn-lg" href="<?php echo esc_url( fragrance_trade_get_mod( 'b2b_hero_secondary_url' ) ); ?>"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_hero_secondary_label' ) ); ?></a>
<a class="btn btn-b2b-primary btn-lg" href="<?php echo esc_url( fragrance_trade_resolve_url( fragrance_trade_get_mod( 'b2b_hero_primary_url' ) ) ); ?>"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_hero_primary_label' ) ); ?></a>
<a class="btn btn-b2b-outline btn-lg" href="<?php echo esc_url( fragrance_trade_resolve_url( fragrance_trade_get_mod( 'b2b_hero_secondary_url' ) ) ); ?>"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_hero_secondary_label' ) ); ?></a>
</div>
<ul class="hero-proof-list" aria-label="<?php esc_attr_e( '施工服务', 'fragrance-trade' ); ?>">
<li><?php esc_html_e( '选膜咨询', 'fragrance-trade' ); ?></li>
<li><?php esc_html_e( '专业施工', 'fragrance-trade' ); ?></li>
<li><?php esc_html_e( '售后保障', 'fragrance-trade' ); ?></li>
<ul class="hero-proof-list" aria-label="<?php esc_attr_e( '服务步骤', 'fragrance-trade' ); ?>">
<li><?php esc_html_e( '需求沟通', 'fragrance-trade' ); ?></li>
<li><?php esc_html_e( '方案确认', 'fragrance-trade' ); ?></li>
<li><?php esc_html_e( '施工交付', 'fragrance-trade' ); ?></li>
</ul>
</div>
</div>
+10 -6
View File
@@ -1,10 +1,15 @@
<?php
/** Service teaser on the homepage. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$service_query = new WP_Query(
array(
'post_type' => 'service',
'posts_per_page' => 6,
'post_status' => 'publish',
'no_found_rows' => true,
)
);
if ( ! $service_query->have_posts() ) {
@@ -15,24 +20,23 @@ if ( ! $service_query->have_posts() ) {
<div class="container">
<div class="section-heading text-center mx-auto">
<p class="section-eyebrow"><?php esc_html_e( '服务项目', 'fragrance-trade' ); ?></p>
<h2><?php esc_html_e( '为您的爱车提供的贴膜服务', 'fragrance-trade' ); ?></h2>
<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 = 'products/placeholder-0' . ( $count < 10 ? $count : 1 ) . '.svg';
$img = $image ? $image : fragrance_trade_asset_uri( $fallback );
$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(); ?>"><img src="<?php echo esc_url( $img ); ?>" alt="<?php the_title_attribute(); ?>" class="img-fluid" loading="lazy" decoding="async"></a></div>
<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/?service=' . rawurlencode( get_the_title() ) ) ); ?>" class="btn btn-b2b-outline"><?php esc_html_e( '预约这项服务', 'fragrance-trade' ); ?></a>
<a href="<?php echo esc_url( home_url( '/contact/' ) ); ?>" class="btn btn-b2b-outline"><?php esc_html_e( '联系门店', 'fragrance-trade' ); ?></a>
</div>
</article>
<?php
+6 -1
View File
@@ -1,4 +1,9 @@
<?php /** Trust metrics — minimalist. @package Fragrance_Trade */ ?>
<?php
/** Trust metrics — minimalist. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<section class="trust-strip" aria-labelledby="trust-strip-title">
<div class="container">
<h2 id="trust-strip-title" class="visually-hidden"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_trust_title' ) ); ?></h2>
+6 -3
View File
@@ -1,9 +1,12 @@
<?php
/** Factory tour video. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! fragrance_trade_show_section( 'b2b_show_video' ) ) { return; }
$url = esc_url( fragrance_trade_get_mod( 'b2b_video_url', '' ) );
$lightbox = $url && preg_match( '/(youtube(?:-nocookie)?\.com|youtu\.be|vimeo\.com)/i', $url );
$url = fragrance_trade_get_mod( 'b2b_video_url', '' );
?>
<section class="factory-video-section">
<div class="container"><div class="factory-video-card"><img src="<?php echo esc_url( fragrance_trade_image_uri( 'b2b_video_image', 'placeholder-video.svg' ) ); ?>" alt="<?php esc_attr_e( '汽车贴膜施工流程示意图', 'fragrance-trade' ); ?>" width="1600" height="899" loading="lazy" decoding="async"><div class="factory-video-overlay"><p class="section-eyebrow"><?php esc_html_e( '门店参观', 'fragrance-trade' ); ?></p><h2><?php echo esc_html( fragrance_trade_get_mod( 'b2b_video_title' ) ); ?></h2><p><?php echo esc_html( fragrance_trade_get_mod( 'b2b_video_text' ) ); ?></p><p class="factory-video-disclosure"><?php esc_html_e( '流程示意图 — 如需查看实拍素材请联系我们。', 'fragrance-trade' ); ?></p><?php if ( $url ) : ?><a class="video-play-link<?php echo $lightbox ? ' youtube' : ''; ?>" href="<?php echo esc_url( $url ); ?>" target="_blank" rel="noopener noreferrer"><svg width="26" height="30" aria-hidden="true"><use href="#play"></use></svg><span><?php esc_html_e( '观看门店视频', 'fragrance-trade' ); ?></span></a><?php else : ?><a class="btn btn-b2b-light" href="<?php echo esc_url( home_url( '/contact/' ) ); ?>"><?php esc_html_e( '获取实拍门店素材', 'fragrance-trade' ); ?></a><?php endif; ?></div></div></div>
<div class="container"><div class="factory-video-card"><img src="<?php echo esc_url( fragrance_trade_image_uri( 'b2b_video_image', 'placeholder-video.svg' ) ); ?>" alt="<?php esc_attr_e( '汽车贴膜施工流程示意图', 'fragrance-trade' ); ?>" width="1600" height="899" loading="lazy" decoding="async"><div class="factory-video-overlay"><p class="section-eyebrow"><?php esc_html_e( '施工流程', 'fragrance-trade' ); ?></p><h2><?php echo esc_html( fragrance_trade_get_mod( 'b2b_video_title' ) ); ?></h2><p><?php echo esc_html( fragrance_trade_get_mod( 'b2b_video_text' ) ); ?></p><p class="factory-video-disclosure"><?php esc_html_e( '页面图片为流程示意;门店实拍内容以实际上传为准。', 'fragrance-trade' ); ?></p><?php if ( $url ) : ?><a class="video-play-link" href="<?php echo esc_url( $url ); ?>" target="_blank" rel="noopener noreferrer"><svg width="26" height="30" aria-hidden="true"><use href="#play"></use></svg><span><?php esc_html_e( '观看门店视频', 'fragrance-trade' ); ?></span></a><?php else : ?><a class="btn btn-b2b-light" href="<?php echo esc_url( home_url( '/contact/' ) ); ?>"><?php esc_html_e( '联系门店查看实拍', 'fragrance-trade' ); ?></a><?php endif; ?></div></div></div>
</section>