feat: initial commit - 汽车贴膜门店 WordPress 主题 (B2B Trade v2.0.0)

- WordPress classic theme for car tinting/foil shop
- 13 homepage template parts
- Customizer panel with 13 sections
- RFQ inquiry form handler
- Bootstrap 5.3 + AOS + Colorbox frontend
- 13 SVG placeholder images
- Chinese content defaults
This commit is contained in:
zhs123
2026-07-24 13:52:59 +08:00
commit 2a64ce8daa
82 changed files with 3344 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
# WordPress
wp-config-local.php
wp-config.php
wp-config-sample.php
# Node / dependencies
node_modules/
npm-debug.log
yarn-error.log
# Build / cache
.cache/
dist/
build/
# OS files
.DS_Store
Thumbs.db
Desktop.ini
# IDE / editor
.vscode/
.idea/
*.swp
*.swo
*~
# WorkBuddy
.workbuddy/
# Environment
.env
.env.local
+13
View File
@@ -0,0 +1,13 @@
<?php
/** Not-found template. @package Fragrance_Trade */
get_header();
?>
<main id="primary" class="site-main container py-5 fragrance-content-area">
<section class="error-404 not-found text-center py-5">
<h1 class="display-4"><?php esc_html_e( '页面未找到', 'fragrance-trade' ); ?></h1>
<p><?php esc_html_e( '页面可能已迁移,请搜索网站或返回首页。', 'fragrance-trade' ); ?></p>
<div class="mx-auto my-4 fragrance-search-form"><?php get_search_form(); ?></div>
<a class="btn btn-dark" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php esc_html_e( '返回首页', 'fragrance-trade' ); ?></a>
</section>
</main>
<?php get_footer(); ?>
+114
View File
@@ -0,0 +1,114 @@
# B2B Trade — 汽车贴膜企业 B2B 主题
B2B Trade 是一款面向 OEM、ODM 和贴牌汽车贴膜制造商的经典 WordPress 主题。专为帮助海外品牌方、进口商、经销商、零售商和项目采购方评估生产能力并提交合格询价而设计。
本主题不依赖 WooCommerce,不含购物车、价格、结账或在线下单流程。产品卡片是工厂生产参考案例,引导买家进入询价表单。附带的参考图片使用浅灰色 SVG 占位符,上线前请替换为实际产品图片。
## 环境要求
- WordPress 6.5 或更高版本
- PHP 7.4 或更高版本
- 生产环境建议使用 HTTPS 和认证 SMTP
## 安装
1.`fragrance-trade` 文件夹复制到 `wp-content/themes/`
2.**外观 → 主题** 中激活 **B2B Trade**
3.**外观 → 自定义 → 站点身份** 中设置站点标题和自定义 Logo。
4. 创建菜单并分配到 **主导航**。未分配时主题使用单页 B2B 回退菜单。
5. 打开 **外观 → 自定义 → B2B 企业首页**,将所有演示文案和图片替换为经验证的工厂信息。
## 首页架构
首页遵循 B2B 采购方的决策路径:
1. 制造商定位与询价入口
2. 工厂合作证明点
3. OEM/ODM 和贴牌服务
4. 产品制造能力
5. 膜料、颜色和包装定制
6. 工厂证明与可选工厂参观视频
7. 品质管控环节
8. 从打样到发货的项目流程
9. 典型采购方项目案例
10. 文档与出口支持
11. 起订量、打样、包装和文件常见问题
12. 合格询价表单
## 自定义器板块
**B2B 企业首页** 面板管理:
- 首屏定位、按钮和图片
- 四个信任/证明点
- 四个 OEM/ODM 服务卡片
- 七个工厂生产产品参考卡片及图片
- 八个定制选项
- 工厂说明、证明点和四张图片
- 工厂参观视频链接和封面
- 六个品质管控环节
- 八个项目流程步骤
- 三个项目案例
- 四个文档卡片
- 八条 B2B 常见问题
- 询价标题和提交按钮文字
- 询价收件邮箱、WhatsApp 和社交链接
指标、认证、起订量、交期、产能、出口市场和可用文件必须在工厂验证后方可发布。
## 询价表单
精简的询价表单仅收集启动对话所需的信息:
- 采购方姓名和企业邮箱
- 可选的公司名称和 WhatsApp/电话
- 所需产品或服务
- 简要需求描述
表单处理器验证 WordPress nonce,拒绝隐藏反垃圾字段,校验四个必填项,应用隐私保护的速率限制,并通过 `wp_mail()` 发送询价邮件。
生产环境请配置认证 SMTP 或事务性邮件插件。上线前请测试有效提交、无效邮箱和重复提交。
## 工厂内容清单
上线前请准备并验证以下内容:
- 公司法定名称和工厂地址
- 成立年份、占地面积、员工人数和产能
- 支持的膜料类型、颜色和表面工艺
- 起订量、样品政策和生产交期
- 工厂、涂布、分切、质检和仓库照片
- 品质管控流程和批次记录
- 认证及每份证书上的确切实体名称
- 各目的地市场的可用文件
- 出口市场和可披露的项目案例
如某项数字或证书无法验证,请保留主题的安全通用文案,不要发布未经支持声明的内容。
## 前端行为
- Bootstrap 提供响应式栅格、offcanvas 导航、手风琴和表单控件。
- WordPress 提供 jQuery;主题不另行打包。
- AOS 和 Colorbox 仅在其 API 可用时初始化。
- 本地 CSS 和 JavaScript 使用文件修改时间版本号防止浏览器缓存过期。
- 产品参考按钮预填询价表单中的产品字段。
- 七个附带的参考产品使用 SVG 占位图,上线前请替换为实拍产品图。
- 工厂流程封面为通用示意图,非特定车间实拍;有实拍素材时请替换。
- 布局包含显式的 `min-width: 0` 栅格边界和移动端水平溢出防护。
## 生产验证
部署后请验证:
1. 首页清晰标识公司为汽车贴膜制造商而非零售品牌。
2. 所有工厂指标、照片、品质声明和文件真实有效。
3. 导航可达服务、产品、工厂、品质、流程和询价。
4. 产品参考按钮正确预填询价产品字段。
5. 精简询价邮件成功送达。
6. 移动端无水平滚动,所有表单字段适配视口。
7. 键盘焦点、跳转链接、标签、手风琴控件和图片替代文本保持可用。
8. 常规文章、页面、归档、搜索和 404 路由正常渲染。
## 许可证
B2B Trade 基于 GNU General Public License v2 or later 许可。打包的第三方前端资源保留其各自许可证。
+52
View File
@@ -0,0 +1,52 @@
<?php
/**
* Case archive template with case_type filter.
*
* @package Fragrance_Trade
*/
get_header();
?>
<main id="primary" class="site-main">
<header class="page-header container py-5">
<h1><?php esc_html_e( '案例作品', 'fragrance-trade' ); ?></h1>
<p><?php esc_html_e( '看看我们为车主完成的贴膜施工案例。', 'fragrance-trade' ); ?></p>
</header>
<div class="container pb-5">
<?php
$case_terms = get_terms(
array(
'taxonomy' => 'case_type',
'hide_empty' => false,
)
);
if ( ! empty( $case_terms ) && ! is_wp_error( $case_terms ) ) :
$current_type = isset( $_GET['case_type'] ) ? sanitize_text_field( wp_unslash( $_GET['case_type'] ) ) : '';
?>
<div class="case-filter mb-4 d-flex flex-wrap gap-2">
<a href="<?php echo esc_url( home_url( '/cases/' ) ); ?>" class="btn btn-sm <?php echo $current_type ? 'btn-outline-secondary' : 'btn-b2b-primary'; ?>"><?php esc_html_e( '全部', 'fragrance-trade' ); ?></a>
<?php foreach ( $case_terms as $term ) : ?>
<a href="<?php echo esc_url( add_query_arg( 'case_type', $term->slug, home_url( '/cases/' ) ) ); ?>" class="btn btn-sm <?php echo $current_type === $term->slug ? 'btn-b2b-primary' : 'btn-outline-secondary'; ?>"><?php echo esc_html( $term->name ); ?></a>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if ( have_posts() ) : ?>
<div class="case-grid">
<?php while ( have_posts() ) : 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( '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; ?>
</div>
<?php the_posts_pagination(); ?>
<?php else : ?>
<p><?php esc_html_e( '案例即将上线,敬请期待。', 'fragrance-trade' ); ?></p>
<?php endif; ?>
</div>
</main>
<?php get_footer(); ?>
+35
View File
@@ -0,0 +1,35 @@
<?php
/**
* Service archive template.
*
* @package Fragrance_Trade
*/
get_header();
?>
<main id="primary" class="site-main">
<header class="page-header container py-5">
<h1><?php esc_html_e( '服务项目', 'fragrance-trade' ); ?></h1>
<p><?php esc_html_e( '我们为各类车型提供专业贴膜施工服务,按需定制。', 'fragrance-trade' ); ?></p>
</header>
<div class="container pb-5">
<div class="capability-grid">
<?php while ( have_posts() ) : the_post(); ?>
<?php
$image = get_post_meta( get_the_ID(), '_service_image', true );
$img = $image ? $image : fragrance_trade_asset_uri( 'products/placeholder-01.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"></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>
</div>
</article>
<?php endwhile; ?>
</div>
<?php the_posts_pagination(); ?>
</div>
</main>
<?php get_footer(); ?>
+18
View File
@@ -0,0 +1,18 @@
<?php
/** Archive template. @package Fragrance_Trade */
get_header();
?>
<main id="primary" class="site-main container py-5 fragrance-content-area">
<header class="page-header mb-5"><h1 class="page-title"><?php the_archive_title(); ?></h1><?php the_archive_description( '<div class="archive-description">', '</div>' ); ?></header>
<?php if ( have_posts() ) : ?>
<div class="row g-5">
<?php while ( have_posts() ) : the_post(); ?>
<div class="col-12"><?php get_template_part( 'template-parts/content', get_post_type() ); ?></div>
<?php endwhile; ?>
</div>
<?php the_posts_pagination(); ?>
<?php else : ?>
<?php get_template_part( 'template-parts/content', 'none' ); ?>
<?php endif; ?>
</main>
<?php get_footer(); ?>
+355
View File
File diff suppressed because one or more lines are too long
+1031
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

+7
View File
@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="600" viewBox="0 0 800 600">
<rect width="800" height="600" fill="#E8E8E8"/>
<rect x="2" y="2" width="796" height="596" fill="none" stroke="#CCCCCC" stroke-width="1" stroke-dasharray="8 4"/>
<text x="400" y="300" text-anchor="middle" dominant-baseline="central"
font-family="system-ui, -apple-system, sans-serif" font-size="33"
fill="#999999" font-weight="500">工厂实景 1</text>
</svg>

After

Width:  |  Height:  |  Size: 470 B

+7
View File
@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="600" viewBox="0 0 800 600">
<rect width="800" height="600" fill="#E8E8E8"/>
<rect x="2" y="2" width="796" height="596" fill="none" stroke="#CCCCCC" stroke-width="1" stroke-dasharray="8 4"/>
<text x="400" y="300" text-anchor="middle" dominant-baseline="central"
font-family="system-ui, -apple-system, sans-serif" font-size="33"
fill="#999999" font-weight="500">工厂实景 2</text>
</svg>

After

Width:  |  Height:  |  Size: 470 B

+7
View File
@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="600" viewBox="0 0 800 600">
<rect width="800" height="600" fill="#E8E8E8"/>
<rect x="2" y="2" width="796" height="596" fill="none" stroke="#CCCCCC" stroke-width="1" stroke-dasharray="8 4"/>
<text x="400" y="300" text-anchor="middle" dominant-baseline="central"
font-family="system-ui, -apple-system, sans-serif" font-size="33"
fill="#999999" font-weight="500">工厂实景 3</text>
</svg>

After

Width:  |  Height:  |  Size: 470 B

+7
View File
@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="600" viewBox="0 0 800 600">
<rect width="800" height="600" fill="#E8E8E8"/>
<rect x="2" y="2" width="796" height="596" fill="none" stroke="#CCCCCC" stroke-width="1" stroke-dasharray="8 4"/>
<text x="400" y="300" text-anchor="middle" dominant-baseline="central"
font-family="system-ui, -apple-system, sans-serif" font-size="33"
fill="#999999" font-weight="500">工厂实景 4</text>
</svg>

After

Width:  |  Height:  |  Size: 470 B

+7
View File
@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="260" height="96" viewBox="0 0 260 96">
<rect width="260" height="96" fill="#E8E8E8"/>
<rect x="2" y="2" width="256" height="92" fill="none" stroke="#CCCCCC" stroke-width="1" stroke-dasharray="8 4"/>
<text x="130" y="48" text-anchor="middle" dominant-baseline="central"
font-family="system-ui, -apple-system, sans-serif" font-size="16"
fill="#999999" font-weight="500">LOGO</text>
</svg>

After

Width:  |  Height:  |  Size: 455 B

+7
View File
@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="899" viewBox="0 0 1600 899">
<rect width="1600" height="899" fill="#E8E8E8"/>
<rect x="2" y="2" width="1596" height="895" fill="none" stroke="#CCCCCC" stroke-width="1" stroke-dasharray="8 4"/>
<text x="800" y="449" text-anchor="middle" dominant-baseline="central"
font-family="system-ui, -apple-system, sans-serif" font-size="49"
fill="#999999" font-weight="500">视频封面</text>
</svg>

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="960" viewBox="0 0 960 960">
<rect width="960" height="960" fill="#E8E8E8"/>
<rect x="2" y="2" width="956" height="956" fill="none" stroke="#CCCCCC" stroke-width="1" stroke-dasharray="8 4"/>
<text x="480" y="480" text-anchor="middle" dominant-baseline="central"
font-family="system-ui, -apple-system, sans-serif" font-size="53"
fill="#999999" font-weight="500">产品图 1</text>
</svg>

After

Width:  |  Height:  |  Size: 467 B

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="960" viewBox="0 0 960 960">
<rect width="960" height="960" fill="#E8E8E8"/>
<rect x="2" y="2" width="956" height="956" fill="none" stroke="#CCCCCC" stroke-width="1" stroke-dasharray="8 4"/>
<text x="480" y="480" text-anchor="middle" dominant-baseline="central"
font-family="system-ui, -apple-system, sans-serif" font-size="53"
fill="#999999" font-weight="500">产品图 2</text>
</svg>

After

Width:  |  Height:  |  Size: 467 B

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="960" viewBox="0 0 960 960">
<rect width="960" height="960" fill="#E8E8E8"/>
<rect x="2" y="2" width="956" height="956" fill="none" stroke="#CCCCCC" stroke-width="1" stroke-dasharray="8 4"/>
<text x="480" y="480" text-anchor="middle" dominant-baseline="central"
font-family="system-ui, -apple-system, sans-serif" font-size="53"
fill="#999999" font-weight="500">产品图 3</text>
</svg>

After

Width:  |  Height:  |  Size: 467 B

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="960" viewBox="0 0 960 960">
<rect width="960" height="960" fill="#E8E8E8"/>
<rect x="2" y="2" width="956" height="956" fill="none" stroke="#CCCCCC" stroke-width="1" stroke-dasharray="8 4"/>
<text x="480" y="480" text-anchor="middle" dominant-baseline="central"
font-family="system-ui, -apple-system, sans-serif" font-size="53"
fill="#999999" font-weight="500">产品图 4</text>
</svg>

After

Width:  |  Height:  |  Size: 467 B

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="960" viewBox="0 0 960 960">
<rect width="960" height="960" fill="#E8E8E8"/>
<rect x="2" y="2" width="956" height="956" fill="none" stroke="#CCCCCC" stroke-width="1" stroke-dasharray="8 4"/>
<text x="480" y="480" text-anchor="middle" dominant-baseline="central"
font-family="system-ui, -apple-system, sans-serif" font-size="53"
fill="#999999" font-weight="500">产品图 5</text>
</svg>

After

Width:  |  Height:  |  Size: 467 B

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="960" viewBox="0 0 960 960">
<rect width="960" height="960" fill="#E8E8E8"/>
<rect x="2" y="2" width="956" height="956" fill="none" stroke="#CCCCCC" stroke-width="1" stroke-dasharray="8 4"/>
<text x="480" y="480" text-anchor="middle" dominant-baseline="central"
font-family="system-ui, -apple-system, sans-serif" font-size="53"
fill="#999999" font-weight="500">产品图 6</text>
</svg>

After

Width:  |  Height:  |  Size: 467 B

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="960" viewBox="0 0 960 960">
<rect width="960" height="960" fill="#E8E8E8"/>
<rect x="2" y="2" width="956" height="956" fill="none" stroke="#CCCCCC" stroke-width="1" stroke-dasharray="8 4"/>
<text x="480" y="480" text-anchor="middle" dominant-baseline="central"
font-family="system-ui, -apple-system, sans-serif" font-size="53"
fill="#999999" font-weight="500">产品图 7</text>
</svg>

After

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 KiB

File diff suppressed because one or more lines are too long
+57
View File
@@ -0,0 +1,57 @@
(function ($) {
'use strict';
document.documentElement.classList.remove('no-js');
document.documentElement.classList.add('js');
var reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
function initStickyHeader() {
var header = document.querySelector('#header');
if (!header) return;
function updateHeader() {
header.classList.toggle('sticky', window.scrollY > 1);
}
updateHeader();
window.addEventListener('scroll', updateHeader, { passive: true });
}
function initAnimations() {
if (!window.AOS || typeof window.AOS.init !== 'function') return;
window.AOS.init({ duration: reducedMotion ? 0 : 700, once: true, disable: reducedMotion });
}
function initVideoLightbox() {
if (!$.fn || typeof $.fn.colorbox !== 'function') return;
$('.youtube').colorbox({ iframe: true, innerWidth: 960, innerHeight: 585, maxWidth: '95%', maxHeight: '90%' });
}
function initNavigation() {
var panel = document.querySelector('#fragrance-navigation');
if (!panel || !window.bootstrap || !window.bootstrap.Offcanvas) return;
panel.querySelectorAll('a[href*="#"]').forEach(function (link) {
link.addEventListener('click', function () {
var instance = window.bootstrap.Offcanvas.getInstance(panel);
if (instance) instance.hide();
});
});
}
function initRfqPrefill() {
var field = document.querySelector('[data-rfq-product-field]');
if (!field) return;
document.querySelectorAll('[data-rfq-product]').forEach(function (trigger) {
trigger.addEventListener('click', function () {
field.value = trigger.dataset.rfqProduct || '';
});
});
}
$(function () {
initStickyHeader();
initAnimations();
initVideoLightbox();
initNavigation();
initRfqPrefill();
});
})(jQuery);
+47
View File
@@ -0,0 +1,47 @@
<?php
/** Site footer. @package Fragrance_Trade */
$fragrance_social_links = array(
'facebook_url' => __( 'Facebook', 'fragrance-trade' ), 'twitter_url' => __( 'X / Twitter', 'fragrance-trade' ),
'youtube_url' => __( 'YouTube', 'fragrance-trade' ), 'linkedin_url' => __( 'LinkedIn', 'fragrance-trade' ),
'instagram_social_url' => __( 'Instagram', 'fragrance-trade' ),
);
$fragrance_email = fragrance_trade_inquiry_email();
$fragrance_whatsapp = fragrance_trade_whatsapp_number();
?>
<footer class="site-footer b2b-footer">
<div class="container py-5">
<div class="row g-5">
<div class="col-lg-5">
<h2 class="h3 text-white mb-3"><?php echo esc_html( get_bloginfo( 'name' ) ); ?></h2>
<p class="footer-positioning"><?php echo esc_html( fragrance_trade_get_mod( 'footer_text' ) ); ?></p>
<p class="footer-kicker mb-0"><?php esc_html_e( '汽车贴膜 · OEM/ODM · 品牌定制', 'fragrance-trade' ); ?></p>
</div>
<div class="col-sm-6 col-lg-3">
<h2 class="h6 text-uppercase text-white mb-3"><?php esc_html_e( '采购资源', 'fragrance-trade' ); ?></h2>
<ul class="list-unstyled footer-links">
<li><a href="<?php echo esc_url( home_url( '/#services' ) ); ?>"><?php esc_html_e( '服务项目', 'fragrance-trade' ); ?></a></li>
<li><a href="<?php echo esc_url( home_url( '/#capabilities' ) ); ?>"><?php esc_html_e( '产品中心', 'fragrance-trade' ); ?></a></li>
<li><a href="<?php echo esc_url( home_url( '/#quality' ) ); ?>"><?php esc_html_e( '品质管控', 'fragrance-trade' ); ?></a></li>
<li><a href="<?php echo esc_url( home_url( '/#rfq' ) ); ?>"><?php esc_html_e( '获取报价', 'fragrance-trade' ); ?></a></li>
</ul>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h6 text-uppercase text-white mb-3"><?php esc_html_e( '开始合作', 'fragrance-trade' ); ?></h2>
<p><a href="mailto:<?php echo esc_attr( antispambot( $fragrance_email ) ); ?>"><?php echo esc_html( antispambot( $fragrance_email ) ); ?></a></p>
<?php if ( $fragrance_whatsapp ) : ?><p><a href="<?php echo esc_url( fragrance_trade_get_inquiry_url() ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( '通过 WhatsApp 联系我们', 'fragrance-trade' ); ?></a></p><?php endif; ?>
<ul class="list-unstyled d-flex flex-wrap gap-3 footer-social mb-0">
<?php foreach ( $fragrance_social_links as $setting => $label ) : $url = fragrance_trade_get_mod( $setting, '' ); if ( $url ) : ?>
<li><a href="<?php echo esc_url( $url ); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html( $label ); ?></a></li>
<?php endif; endforeach; ?>
</ul>
</div>
</div>
<div class="footer-bottom d-flex flex-wrap justify-content-between gap-2 pt-4 mt-4 border-top">
<p class="mb-0">&copy; <?php echo esc_html( wp_date( 'Y' ) ); ?> <?php echo esc_html( get_bloginfo( 'name' ) ); ?></p>
<p class="mb-0"><?php esc_html_e( '规格与供货以项目确认为准。', 'fragrance-trade' ); ?></p>
</div>
</div>
</footer>
<?php wp_footer(); ?>
</body>
</html>
+16
View File
@@ -0,0 +1,16 @@
<?php
/**
* Static homepage (landing) template.
*
* @package Fragrance_Trade
*/
get_header();
?>
<main id="primary" class="site-main fragrance-homepage">
<?php get_template_part( 'template-parts/home/hero' ); ?>
<?php get_template_part( 'template-parts/home/trust' ); ?>
<?php get_template_part( 'template-parts/home/service-teaser' ); ?>
<?php get_template_part( 'template-parts/home/case-teaser' ); ?>
<?php get_template_part( 'template-parts/home/cta' ); ?>
</main>
<?php get_footer(); ?>
+24
View File
@@ -0,0 +1,24 @@
<?php
/**
* Fragrance Trade theme bootstrap.
*
* @package Fragrance_Trade
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$fragrance_trade_modules = array(
'defaults.php',
'setup.php',
'helpers.php',
'cpt.php',
'customizer.php',
'inquiry.php',
);
foreach ( $fragrance_trade_modules as $fragrance_trade_module ) {
require_once get_template_directory() . '/inc/' . $fragrance_trade_module;
}
+43
View File
@@ -0,0 +1,43 @@
<?php
/** Site header. @package Fragrance_Trade */
$fragrance_rfq_url = is_front_page() ? '#rfq' : home_url( '/#rfq' );
?><!doctype html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>
<body <?php body_class( 'bg-body' ); ?>>
<?php wp_body_open(); ?>
<a class="skip-link screen-reader-text" href="#primary"><?php esc_html_e( '跳转到内容', 'fragrance-trade' ); ?></a>
<svg class="fragrance-symbols" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
<symbol id="navbar-icon" viewBox="0 0 16 16"><path d="M14 10.5a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0 0 1h3a.5.5 0 0 0 .5-.5zm0-3a.5.5 0 0 0-.5-.5h-7a.5.5 0 0 0 0 1h7a.5.5 0 0 0 .5-.5zm0-3a.5.5 0 0 0-.5-.5h-11a.5.5 0 0 0 0 1h11a.5.5 0 0 0 .5-.5z"/></symbol>
<symbol id="play" viewBox="0 0 32 32"><path fill="currentColor" d="M7 28a1 1 0 0 1-1-1V5a1 1 0 0 1 1.482-.876l20 11a1 1 0 0 1 0 1.752l-20 11A1 1 0 0 1 7 28ZM8 6.69v18.62L24.925 16Z"/></symbol>
</svg>
<header id="header" class="site-header b2b-header fixed-top">
<nav id="header-nav" class="navbar navbar-expand-xl" aria-label="<?php esc_attr_e( '主导航', 'fragrance-trade' ); ?>">
<div class="container-fluid px-lg-5">
<div class="site-branding navbar-brand">
<?php if ( has_custom_logo() ) : ?>
<?php the_custom_logo(); ?>
<?php else : ?>
<a class="b2b-wordmark" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo esc_html( get_bloginfo( 'name' ) ); ?></a>
<?php endif; ?>
</div>
<button class="navbar-toggler d-flex d-xl-none order-3 p-2 border-0 shadow-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#fragrance-navigation" aria-controls="fragrance-navigation" aria-expanded="false" aria-label="<?php esc_attr_e( '打开导航', 'fragrance-trade' ); ?>">
<svg class="navbar-icon" width="44" height="44" aria-hidden="true"><use href="#navbar-icon"></use></svg>
</button>
<div class="offcanvas offcanvas-end" tabindex="-1" id="fragrance-navigation" aria-labelledby="fragrance-navigation-title">
<div class="offcanvas-header px-4 pb-0">
<span class="h5 offcanvas-title" id="fragrance-navigation-title"><?php echo esc_html( get_bloginfo( 'name' ) ); ?></span>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="<?php esc_attr_e( '关闭导航', 'fragrance-trade' ); ?>"></button>
</div>
<div class="offcanvas-body align-items-center">
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'navbar-nav justify-content-end flex-grow-1 gap-xl-4 pe-xl-3', 'container' => false, 'fallback_cb' => 'fragrance_trade_fallback_menu' ) ); ?>
<a class="btn b2b-header-cta ms-xl-3" href="<?php echo esc_url( $fragrance_rfq_url ); ?>"><?php esc_html_e( '获取报价', 'fragrance-trade' ); ?></a>
</div>
</div>
</div>
</nav>
</header>
+154
View File
@@ -0,0 +1,154 @@
<?php
/**
* Custom post types: service (服务项目/膜品) and case (案例作品集).
* 主题激活时把 Customizer 中的 7 个产品迁移为 service 文章,并创建默认页面。
*
* @package Fragrance_Trade
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/** Register the service and case post types plus the case_type taxonomy. */
function fragrance_trade_register_post_types() {
register_post_type(
'service',
array(
'labels' => array(
'name' => __( '服务项目', 'fragrance-trade' ),
'singular_name' => __( '服务项目', 'fragrance-trade' ),
'add_new' => __( '添加服务项目', 'fragrance-trade' ),
'edit_item' => __( '编辑服务项目', 'fragrance-trade' ),
'all_items' => __( '全部服务项目', 'fragrance-trade' ),
),
'public' => true,
'has_archive' => 'services',
'rewrite' => array( 'slug' => 'services' ),
'menu_position' => 20,
'menu_icon' => 'dashicons-admin-customizer',
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt' ),
'show_in_rest' => true,
)
);
register_post_type(
'case',
array(
'labels' => array(
'name' => __( '案例作品', 'fragrance-trade' ),
'singular_name' => __( '案例', 'fragrance-trade' ),
'add_new' => __( '添加案例', 'fragrance-trade' ),
'edit_item' => __( '编辑案例', 'fragrance-trade' ),
'all_items' => __( '全部案例', 'fragrance-trade' ),
),
'public' => true,
'has_archive' => 'cases',
'rewrite' => array( 'slug' => 'cases' ),
'menu_position' => 21,
'menu_icon' => 'dashicons-format-gallery',
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt' ),
'show_in_rest' => true,
)
);
register_taxonomy(
'case_type',
'case',
array(
'labels' => array(
'name' => __( '案例分类', 'fragrance-trade' ),
'singular_name' => __( '案例分类', 'fragrance-trade' ),
),
'public' => true,
'hierarchical' => false,
'show_in_rest' => true,
'rewrite' => array( 'slug' => 'case-type' ),
)
);
}
add_action( 'init', 'fragrance_trade_register_post_types' );
/** Filter the case archive by the case_type query argument. */
function fragrance_trade_filter_cases_archive( $query ) {
if ( is_admin() || ! $query->is_main_query() ) {
return;
}
if ( $query->is_post_type_archive( 'case' ) && ! empty( $_GET['case_type'] ) ) {
$query->set( 'case_type', sanitize_text_field( wp_unslash( $_GET['case_type'] ) ) );
}
}
add_action( 'pre_get_posts', 'fragrance_trade_filter_cases_archive' );
/** One-time setup on theme activation: migrate products and create pages. */
function fragrance_trade_setup_site_on_activation() {
if ( get_option( 'fragrance_trade_setup_done' ) ) {
return;
}
$product_fallbacks = array(
'products/placeholder-01.svg',
'products/placeholder-02.svg',
'products/placeholder-03.svg',
'products/placeholder-04.svg',
'products/placeholder-05.svg',
'products/placeholder-06.svg',
'products/placeholder-07.svg',
);
for ( $index = 1; $index <= count( $product_fallbacks ); $index++ ) {
$title = fragrance_trade_get_mod( 'b2b_product_' . $index . '_title' );
if ( ! $title ) {
continue;
}
$post_id = wp_insert_post(
array(
'post_type' => 'service',
'post_title' => $title,
'post_content' => fragrance_trade_get_mod( 'b2b_product_' . $index . '_text' ),
'post_excerpt' => fragrance_trade_get_mod( 'b2b_product_' . $index . '_specs' ),
'post_status' => 'publish',
)
);
if ( $post_id && ! is_wp_error( $post_id ) ) {
$image = fragrance_trade_get_mod( 'b2b_product_' . $index . '_image', '' );
if ( $image ) {
update_post_meta( $post_id, '_service_image', $image );
}
}
}
$pages = array(
'home' => array( 'post_title' => __( '首页', 'fragrance-trade' ), 'template' => '' ),
'about' => array( 'post_title' => __( '关于门店', 'fragrance-trade' ), 'template' => 'page-about.php' ),
'faq' => array( 'post_title' => __( '常见问题', 'fragrance-trade' ), 'template' => 'page-faq.php' ),
'contact' => array( 'post_title' => __( '预约/联系', 'fragrance-trade' ), 'template' => 'page-contact.php' ),
);
$created = array();
foreach ( $pages as $slug => $data ) {
$existing = get_page_by_path( $slug );
if ( $existing ) {
$created[ $slug ] = $existing->ID;
continue;
}
$id = wp_insert_post(
array(
'post_type' => 'page',
'post_name' => $slug,
'post_title' => $data['post_title'],
'post_status' => 'publish',
'page_template' => $data['template'],
)
);
if ( $id && ! is_wp_error( $id ) ) {
$created[ $slug ] = $id;
}
}
if ( ! empty( $created['home'] ) ) {
update_option( 'page_on_front', $created['home'] );
update_option( 'show_on_front', 'page' );
}
update_option( 'fragrance_trade_setup_done', 1 );
}
add_action( 'after_switch_theme', 'fragrance_trade_setup_site_on_activation' );
+158
View File
@@ -0,0 +1,158 @@
<?php
/** WordPress Customizer controls for the B2B factory homepage. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
function fragrance_trade_sanitize_checkbox( $checked ) {
return isset( $checked ) && true === (bool) $checked;
}
function fragrance_trade_customize_add_field( $wp_customize, $id, $section, $label, $type = 'text', $priority = 10 ) {
$sanitizers = array(
'text' => 'sanitize_text_field',
'textarea' => 'sanitize_textarea_field',
'url' => 'esc_url_raw',
'email' => 'sanitize_email',
'checkbox' => 'fragrance_trade_sanitize_checkbox',
'image' => 'esc_url_raw',
);
$wp_customize->add_setting(
$id,
array(
'default' => fragrance_trade_get_default( $id ),
'sanitize_callback' => $sanitizers[ $type ],
'transport' => 'refresh',
)
);
if ( 'image' === $type ) {
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
$id,
array( 'label' => $label, 'section' => $section, 'priority' => $priority )
)
);
return;
}
$wp_customize->add_control( $id, array( 'label' => $label, 'section' => $section, 'type' => $type, 'priority' => $priority ) );
}
function fragrance_trade_customize_register( $wp_customize ) {
$wp_customize->add_panel(
'fragrance_b2b_homepage',
array(
'title' => __( 'B2B 企业首页', 'fragrance-trade' ),
'description' => __( '编辑固定布局的 OEM/ODM 汽车贴膜企业首页。上线前请将所有演示文案替换为经验证的工厂信息。', 'fragrance-trade' ),
'priority' => 30,
)
);
$sections = array(
'fragrance_b2b_hero' => __( '首屏定位', 'fragrance-trade' ),
'fragrance_b2b_trust' => __( '信任栏', 'fragrance-trade' ),
'fragrance_b2b_services' => __( '服务项目', 'fragrance-trade' ),
'fragrance_b2b_products' => __( '产品能力', 'fragrance-trade' ),
'fragrance_b2b_customization' => __( '定制选项', 'fragrance-trade' ),
'fragrance_b2b_factory' => __( '工厂证明与参观', 'fragrance-trade' ),
'fragrance_b2b_quality' => __( '品质管控', 'fragrance-trade' ),
'fragrance_b2b_process' => __( '项目流程', 'fragrance-trade' ),
'fragrance_b2b_projects' => __( '项目案例', 'fragrance-trade' ),
'fragrance_b2b_documents' => __( '文档支持', 'fragrance-trade' ),
'fragrance_b2b_faq' => __( '常见问题', 'fragrance-trade' ),
'fragrance_b2b_rfq' => __( '询价表单', 'fragrance-trade' ),
'fragrance_contact_social' => __( '联系方式与社交链接', 'fragrance-trade' ),
);
$priority = 10;
foreach ( $sections as $id => $title ) {
$wp_customize->add_section( $id, array( 'title' => $title, 'panel' => 'fragrance_b2b_homepage', 'priority' => $priority ) );
$priority += 10;
}
$fields = array(
array( 'b2b_hero_eyebrow', 'fragrance_b2b_hero', __( '眉标', 'fragrance-trade' ), 'text' ),
array( 'b2b_hero_title', 'fragrance_b2b_hero', __( '主标题', 'fragrance-trade' ), 'text' ),
array( 'b2b_hero_text', 'fragrance_b2b_hero', __( '简介文案', 'fragrance-trade' ), 'textarea' ),
array( 'b2b_hero_primary_label', 'fragrance_b2b_hero', __( '主按钮文字', 'fragrance-trade' ), 'text' ),
array( 'b2b_hero_primary_url', 'fragrance_b2b_hero', __( '主按钮链接', 'fragrance-trade' ), 'url' ),
array( 'b2b_hero_secondary_label', 'fragrance_b2b_hero', __( '次按钮文字', 'fragrance-trade' ), 'text' ),
array( 'b2b_hero_secondary_url', 'fragrance_b2b_hero', __( '次按钮链接', 'fragrance-trade' ), 'url' ),
array( 'b2b_trust_title', 'fragrance_b2b_trust', __( '信任栏标题', 'fragrance-trade' ), 'text' ),
array( 'b2b_services_title', 'fragrance_b2b_services', __( '板块标题', 'fragrance-trade' ), 'text' ),
array( 'b2b_services_text', 'fragrance_b2b_services', __( '板块简介', 'fragrance-trade' ), 'textarea' ),
array( 'b2b_products_title', 'fragrance_b2b_products', __( '板块标题', 'fragrance-trade' ), 'text' ),
array( 'b2b_products_text', 'fragrance_b2b_products', __( '板块简介', 'fragrance-trade' ), 'textarea' ),
array( 'b2b_custom_title', 'fragrance_b2b_customization', __( '板块标题', 'fragrance-trade' ), 'text' ),
array( 'b2b_custom_text', 'fragrance_b2b_customization', __( '板块简介', 'fragrance-trade' ), 'textarea' ),
array( 'b2b_factory_eyebrow', 'fragrance_b2b_factory', __( '眉标', 'fragrance-trade' ), 'text' ),
array( 'b2b_factory_title', 'fragrance_b2b_factory', __( '板块标题', 'fragrance-trade' ), 'text' ),
array( 'b2b_factory_text', 'fragrance_b2b_factory', __( '工厂简介', 'fragrance-trade' ), 'textarea' ),
array( 'b2b_show_video', 'fragrance_b2b_factory', __( '显示工厂视频', 'fragrance-trade' ), 'checkbox' ),
array( 'b2b_video_title', 'fragrance_b2b_factory', __( '视频标题', 'fragrance-trade' ), 'text' ),
array( 'b2b_video_text', 'fragrance_b2b_factory', __( '视频描述', 'fragrance-trade' ), 'textarea' ),
array( 'b2b_video_url', 'fragrance_b2b_factory', __( 'YouTube、Vimeo 或视频链接', 'fragrance-trade' ), 'url' ),
array( 'b2b_video_image', 'fragrance_b2b_factory', __( '视频封面图', 'fragrance-trade' ), 'image' ),
array( 'b2b_quality_title', 'fragrance_b2b_quality', __( '板块标题', 'fragrance-trade' ), 'text' ),
array( 'b2b_quality_text', 'fragrance_b2b_quality', __( '板块简介', 'fragrance-trade' ), 'textarea' ),
array( 'b2b_process_title', 'fragrance_b2b_process', __( '板块标题', 'fragrance-trade' ), 'text' ),
array( 'b2b_process_text', 'fragrance_b2b_process', __( '板块简介', 'fragrance-trade' ), 'textarea' ),
array( 'b2b_show_projects', 'fragrance_b2b_projects', __( '显示项目案例', 'fragrance-trade' ), 'checkbox' ),
array( 'b2b_projects_title', 'fragrance_b2b_projects', __( '板块标题', 'fragrance-trade' ), 'text' ),
array( 'b2b_projects_text', 'fragrance_b2b_projects', __( '板块简介', 'fragrance-trade' ), 'textarea' ),
array( 'b2b_show_documents', 'fragrance_b2b_documents', __( '显示文档板块', 'fragrance-trade' ), 'checkbox' ),
array( 'b2b_documents_title', 'fragrance_b2b_documents', __( '板块标题', 'fragrance-trade' ), 'text' ),
array( 'b2b_documents_text', 'fragrance_b2b_documents', __( '板块简介', 'fragrance-trade' ), 'textarea' ),
array( 'b2b_show_faq', 'fragrance_b2b_faq', __( '显示常见问题', 'fragrance-trade' ), 'checkbox' ),
array( 'b2b_faq_title', 'fragrance_b2b_faq', __( '常见问题标题', 'fragrance-trade' ), 'text' ),
array( 'b2b_rfq_title', 'fragrance_b2b_rfq', __( '询价标题', 'fragrance-trade' ), 'text' ),
array( 'b2b_rfq_text', 'fragrance_b2b_rfq', __( '询价简介', 'fragrance-trade' ), 'textarea' ),
array( 'b2b_rfq_button_label', 'fragrance_b2b_rfq', __( '提交按钮文字', 'fragrance-trade' ), 'text' ),
array( 'inquiry_email', 'fragrance_contact_social', __( '询价收件邮箱', 'fragrance-trade' ), 'email' ),
array( 'whatsapp', 'fragrance_contact_social', __( 'WhatsApp 号码(含国家代码)', 'fragrance-trade' ), 'text' ),
array( 'facebook_url', 'fragrance_contact_social', __( 'Facebook 链接', 'fragrance-trade' ), 'url' ),
array( 'twitter_url', 'fragrance_contact_social', __( 'X / Twitter 链接', 'fragrance-trade' ), 'url' ),
array( 'youtube_url', 'fragrance_contact_social', __( 'YouTube 链接', 'fragrance-trade' ), 'url' ),
array( 'linkedin_url', 'fragrance_contact_social', __( 'LinkedIn 链接', 'fragrance-trade' ), 'url' ),
array( 'instagram_social_url', 'fragrance_contact_social', __( 'Instagram 链接', 'fragrance-trade' ), 'url' ),
array( 'footer_text', 'fragrance_contact_social', __( '页脚定位文案', 'fragrance-trade' ), 'text' ),
);
for ( $index = 1; $index <= 4; $index++ ) {
$fields[] = array( 'b2b_metric_' . $index . '_value', 'fragrance_b2b_trust', sprintf( __( '信任点 %d 数值', 'fragrance-trade' ), $index ), 'text' );
$fields[] = array( 'b2b_metric_' . $index . '_label', 'fragrance_b2b_trust', sprintf( __( '信任点 %d 标签', 'fragrance-trade' ), $index ), 'text' );
$fields[] = array( 'b2b_service_' . $index . '_title', 'fragrance_b2b_services', sprintf( __( '服务 %d 标题', 'fragrance-trade' ), $index ), 'text' );
$fields[] = array( 'b2b_service_' . $index . '_text', 'fragrance_b2b_services', sprintf( __( '服务 %d 描述', 'fragrance-trade' ), $index ), 'textarea' );
$fields[] = array( 'b2b_factory_point_' . $index, 'fragrance_b2b_factory', sprintf( __( '工厂证明点 %d', 'fragrance-trade' ), $index ), 'text' );
$fields[] = array( 'b2b_factory_image_' . $index, 'fragrance_b2b_factory', sprintf( __( '工厂图片 %d', 'fragrance-trade' ), $index ), 'image' );
$fields[] = array( 'b2b_document_' . $index . '_title', 'fragrance_b2b_documents', sprintf( __( '文档卡片 %d 标题', 'fragrance-trade' ), $index ), 'text' );
$fields[] = array( 'b2b_document_' . $index . '_text', 'fragrance_b2b_documents', sprintf( __( '文档卡片 %d 描述', 'fragrance-trade' ), $index ), 'textarea' );
}
for ( $index = 1; $index <= 7; $index++ ) {
$fields[] = array( 'b2b_product_' . $index . '_title', 'fragrance_b2b_products', sprintf( __( '产品参考 %d 标题', 'fragrance-trade' ), $index ), 'text' );
$fields[] = array( 'b2b_product_' . $index . '_text', 'fragrance_b2b_products', sprintf( __( '产品参考 %d 描述', 'fragrance-trade' ), $index ), 'textarea' );
$fields[] = array( 'b2b_product_' . $index . '_specs', 'fragrance_b2b_products', sprintf( __( '产品参考 %d 规格行', 'fragrance-trade' ), $index ), 'text' );
$fields[] = array( 'b2b_product_' . $index . '_image', 'fragrance_b2b_products', sprintf( __( '产品参考 %d 图片', 'fragrance-trade' ), $index ), 'image' );
}
for ( $index = 1; $index <= 8; $index++ ) {
$fields[] = array( 'b2b_custom_' . $index . '_title', 'fragrance_b2b_customization', sprintf( __( '定制项 %d', 'fragrance-trade' ), $index ), 'text' );
$fields[] = array( 'b2b_process_' . $index . '_title', 'fragrance_b2b_process', sprintf( __( '流程步骤 %d 标题', 'fragrance-trade' ), $index ), 'text' );
$fields[] = array( 'b2b_process_' . $index . '_text', 'fragrance_b2b_process', sprintf( __( '流程步骤 %d 描述', 'fragrance-trade' ), $index ), 'textarea' );
$fields[] = array( 'b2b_faq_' . $index . '_question', 'fragrance_b2b_faq', sprintf( __( '问题 %d', 'fragrance-trade' ), $index ), 'text' );
$fields[] = array( 'b2b_faq_' . $index . '_answer', 'fragrance_b2b_faq', sprintf( __( '回答 %d', 'fragrance-trade' ), $index ), 'textarea' );
}
for ( $index = 1; $index <= 6; $index++ ) {
$fields[] = array( 'b2b_quality_' . $index . '_title', 'fragrance_b2b_quality', sprintf( __( '品质步骤 %d 标题', 'fragrance-trade' ), $index ), 'text' );
$fields[] = array( 'b2b_quality_' . $index . '_text', 'fragrance_b2b_quality', sprintf( __( '品质步骤 %d 描述', 'fragrance-trade' ), $index ), 'textarea' );
}
for ( $index = 1; $index <= 3; $index++ ) {
$fields[] = array( 'b2b_project_' . $index . '_title', 'fragrance_b2b_projects', sprintf( __( '项目案例 %d 标题', 'fragrance-trade' ), $index ), 'text' );
$fields[] = array( 'b2b_project_' . $index . '_meta', 'fragrance_b2b_projects', sprintf( __( '项目案例 %d 标签', 'fragrance-trade' ), $index ), 'text' );
$fields[] = array( 'b2b_project_' . $index . '_text', 'fragrance_b2b_projects', sprintf( __( '项目案例 %d 描述', 'fragrance-trade' ), $index ), 'textarea' );
}
foreach ( $fields as $field ) {
fragrance_trade_customize_add_field( $wp_customize, $field[0], $field[1], $field[2], $field[3] );
}
}
add_action( 'customize_register', 'fragrance_trade_customize_register' );
+182
View File
@@ -0,0 +1,182 @@
<?php
/**
* 汽车贴膜企业 B2B 通用模板默认值。
*
* @package Fragrance_Trade
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/** Return all theme defaults. */
function fragrance_trade_defaults() {
return array(
'b2b_hero_eyebrow' => __( '汽车贴膜 · 专业制造', 'fragrance-trade' ),
'b2b_hero_title' => __( '专业汽车贴膜制造商,为品牌提供一站式贴膜解决方案', 'fragrance-trade' ),
'b2b_hero_text' => __( '从膜料研发、色彩定制到裁切包装和出口支持,我们帮助客户将概念转化为市场领先的汽车贴膜产品。', 'fragrance-trade' ),
'b2b_hero_primary_label' => __( '获取报价', 'fragrance-trade' ),
'b2b_hero_primary_url' => '#rfq',
'b2b_hero_secondary_label' => __( '了解生产能力', 'fragrance-trade' ),
'b2b_hero_secondary_url' => '#capabilities',
'b2b_trust_title' => __( '从概念到交付的专业制造伙伴', 'fragrance-trade' ),
'b2b_metric_1_value' => __( 'OEM / ODM', 'fragrance-trade' ),
'b2b_metric_1_label' => __( '灵活合作模式', 'fragrance-trade' ),
'b2b_metric_2_value' => __( '一站式', 'fragrance-trade' ),
'b2b_metric_2_label' => __( '从膜料到成品包装', 'fragrance-trade' ),
'b2b_metric_3_value' => __( '批次质检', 'fragrance-trade' ),
'b2b_metric_3_label' => __( '出货前品质检验', 'fragrance-trade' ),
'b2b_metric_4_value' => __( '全球覆盖', 'fragrance-trade' ),
'b2b_metric_4_label' => __( '出口项目支持', 'fragrance-trade' ),
'b2b_services_title' => __( '围绕您的项目定制的贴膜服务', 'fragrance-trade' ),
'b2b_services_text' => __( '选择与您的品牌、产品和上市计划匹配的合作起点。', 'fragrance-trade' ),
'b2b_service_1_title' => __( '品牌贴膜定制', 'fragrance-trade' ),
'b2b_service_1_text' => __( '从现有膜料、颜色和规格中选择,打造您的品牌贴膜系列。', 'fragrance-trade' ),
'b2b_service_2_title' => __( 'OEM 代工生产', 'fragrance-trade' ),
'b2b_service_2_text' => __( '根据您认可的配方、参考样品或产品规格进行生产制造。', 'fragrance-trade' ),
'b2b_service_3_title' => __( 'ODM 产品开发', 'fragrance-trade' ),
'b2b_service_3_text' => __( '涵盖膜料选型、颜色开发、样品制作和量产准备的全程项目支持。', 'fragrance-trade' ),
'b2b_service_4_title' => __( '包装与定制', 'fragrance-trade' ),
'b2b_service_4_text' => __( '协调卷芯、外包装、标签和运输包装,贴合您的品牌定位。', 'fragrance-trade' ),
'b2b_products_title' => __( '工厂生产的贴膜产品参考', 'fragrance-trade' ),
'b2b_products_text' => __( '以下为我们工厂生产的部分产品。客户品牌信息已做模糊处理以保护保密性,产品质感和工艺细节完整可见。', 'fragrance-trade' ),
'b2b_product_1_title' => __( '隐形车衣(TPU 保护膜)', 'fragrance-trade' ),
'b2b_product_1_text' => __( '高透明度 TPU 材质,具备自修复功能,有效保护车漆免受石子划伤和紫外线损伤。', 'fragrance-trade' ),
'b2b_product_1_specs' => __( 'TPU 材质 · 自修复 · 高透光 · 抗黄变', 'fragrance-trade' ),
'b2b_product_1_image' => '',
'b2b_product_2_title' => __( '彩色改色膜', 'fragrance-trade' ),
'b2b_product_2_text' => __( '丰富色彩选择,高分子 PVC 材质,贴合度高,可实现哑光、亮面、珠光等多种表面效果。', 'fragrance-trade' ),
'b2b_product_2_specs' => __( 'PVC 材质 · 多色可选 · 哑光/亮面 · 高贴合', 'fragrance-trade' ),
'b2b_product_2_image' => '',
'b2b_product_3_title' => __( '隔热防爆膜', 'fragrance-trade' ),
'b2b_product_3_text' => __( '高效隔热阻紫外线,提升车内舒适度,多层金属镀膜工艺确保清晰视野与安全性。', 'fragrance-trade' ),
'b2b_product_3_specs' => __( '多层金属 · 隔热阻紫 · 高透光 · 防爆', 'fragrance-trade' ),
'b2b_product_3_image' => '',
'b2b_product_4_title' => __( '陶瓷隔热膜', 'fragrance-trade' ),
'b2b_product_4_text' => __( '纳米陶瓷技术,不屏蔽信号,隔热性能卓越,适合高端车型及电子设备密集车辆。', 'fragrance-trade' ),
'b2b_product_4_specs' => __( '纳米陶瓷 · 不挡信号 · 超强隔热 · 持久耐用', 'fragrance-trade' ),
'b2b_product_4_image' => '',
'b2b_product_5_title' => __( '天窗冰甲', 'fragrance-trade' ),
'b2b_product_5_text' => __( '专为全景天窗设计,高隔热率搭配防爆功能,降低车内温度同时提升安全性。', 'fragrance-trade' ),
'b2b_product_5_specs' => __( '天窗专用 · 高隔热 · 防爆 · 降噪', 'fragrance-trade' ),
'b2b_product_5_image' => '',
'b2b_product_6_title' => __( '前挡专用膜', 'fragrance-trade' ),
'b2b_product_6_text' => __( '前挡风玻璃专用配方,高透光率符合国家标准,兼顾隔热性能与驾驶视野。', 'fragrance-trade' ),
'b2b_product_6_specs' => __( '前挡专用 · 高透光 · 符合国标 · 隔热', 'fragrance-trade' ),
'b2b_product_6_image' => '',
'b2b_product_7_title' => __( '个性定制彩绘膜', 'fragrance-trade' ),
'b2b_product_7_text' => __( '支持图案定制、品牌 LOGO 印刷,适用于商业车队包装和个性化改装需求。', 'fragrance-trade' ),
'b2b_product_7_specs' => __( '图案定制 · LOGO 印刷 · 车队包装 · 个性改装', 'fragrance-trade' ),
'b2b_product_7_image' => '',
'b2b_custom_title' => __( '定制产品的每一个细节', 'fragrance-trade' ),
'b2b_custom_text' => __( '选择并确认影响产品性能、外观和成本的关键要素。', 'fragrance-trade' ),
'b2b_custom_1_title' => __( '膜料选型', 'fragrance-trade' ),
'b2b_custom_2_title' => __( '颜色定制', 'fragrance-trade' ),
'b2b_custom_3_title' => __( '厚度规格', 'fragrance-trade' ),
'b2b_custom_4_title' => __( '宽度规格', 'fragrance-trade' ),
'b2b_custom_5_title' => __( '表面工艺', 'fragrance-trade' ),
'b2b_custom_6_title' => __( '图案定制', 'fragrance-trade' ),
'b2b_custom_7_title' => __( '包装设计', 'fragrance-trade' ),
'b2b_custom_8_title' => __( '出口标识', 'fragrance-trade' ),
'b2b_factory_eyebrow' => __( '工厂与生产', 'fragrance-trade' ),
'b2b_factory_title' => __( '可验证的生产实力', 'fragrance-trade' ),
'b2b_factory_text' => __( '在正式上线前,请用经过验证的工厂数据、生产照片和能力说明替换以下演示内容。', 'fragrance-trade' ),
'b2b_factory_point_1' => __( '自有涂布与分切生产线', 'fragrance-trade' ),
'b2b_factory_point_2' => __( '量产前样品确认制度', 'fragrance-trade' ),
'b2b_factory_point_3' => __( '原材料与包装协调管理', 'fragrance-trade' ),
'b2b_factory_point_4' => __( '生产与发货进度透明沟通', 'fragrance-trade' ),
'b2b_factory_image_1' => '',
'b2b_factory_image_2' => '',
'b2b_factory_image_3' => '',
'b2b_factory_image_4' => '',
'b2b_show_video' => true,
'b2b_video_title' => __( '汽车贴膜生产流程', 'fragrance-trade' ),
'b2b_video_text' => __( '了解涂布、分切、质检和包装如何在一条生产线上协同完成。', 'fragrance-trade' ),
'b2b_video_url' => '',
'b2b_video_image' => '',
'b2b_quality_title' => __( '每个生产环节的品质管控', 'fragrance-trade' ),
'b2b_quality_text' => __( '具体检验方案根据每份已确认的产品规格和目的地要求制定。', 'fragrance-trade' ),
'b2b_quality_1_title' => __( '来料检验', 'fragrance-trade' ),
'b2b_quality_1_text' => __( '生产前对原材料、基膜和包装材料进行验收。', 'fragrance-trade' ),
'b2b_quality_2_title' => __( '样品确认', 'fragrance-trade' ),
'b2b_quality_2_text' => __( '以已确认的样品和规格作为生产基准。', 'fragrance-trade' ),
'b2b_quality_3_title' => __( '生产过程检验', 'fragrance-trade' ),
'b2b_quality_3_text' => __( '监控涂布厚度、贴合度和工艺一致性。', 'fragrance-trade' ),
'b2b_quality_4_title' => __( '色差检测', 'fragrance-trade' ),
'b2b_quality_4_text' => __( '使用分光仪对颜色一致性进行检测。', 'fragrance-trade' ),
'b2b_quality_5_title' => __( '成品外观检验', 'fragrance-trade' ),
'b2b_quality_5_text' => __( '检查膜面瑕疵、分切边缘和包装外观。', 'fragrance-trade' ),
'b2b_quality_6_title' => __( '出货前复查', 'fragrance-trade' ),
'b2b_quality_6_text' => __( '发货前复核成品、包装和运输标识。', 'fragrance-trade' ),
'b2b_process_title' => __( '清晰的 OEM/ODM 项目流程', 'fragrance-trade' ),
'b2b_process_text' => __( '每个阶段都有明确的客户输入和工厂输出,确保决策过程透明。', 'fragrance-trade' ),
'b2b_process_1_title' => __( '提交需求', 'fragrance-trade' ),
'b2b_process_1_text' => __( '提供市场定位、产品类型、数量、包装和上市计划。', 'fragrance-trade' ),
'b2b_process_2_title' => __( '项目评估', 'fragrance-trade' ),
'b2b_process_2_text' => __( '确认可行性、信息缺口和报价所需资料。', 'fragrance-trade' ),
'b2b_process_3_title' => __( '选择膜料与规格', 'fragrance-trade' ),
'b2b_process_3_text' => __( '确定膜料类型、颜色、厚度、宽度和包装方案。', 'fragrance-trade' ),
'b2b_process_4_title' => __( '打样', 'fragrance-trade' ),
'b2b_process_4_text' => __( '按需制备膜料和包装样品供评审。', 'fragrance-trade' ),
'b2b_process_5_title' => __( '样品确认', 'fragrance-trade' ),
'b2b_process_5_text' => __( '锁定已确认的参考样和生产规格。', 'fragrance-trade' ),
'b2b_process_6_title' => __( '订单确认', 'fragrance-trade' ),
'b2b_process_6_text' => __( '确认商务条款、数量、图案和交期。', 'fragrance-trade' ),
'b2b_process_7_title' => __( '生产与质检', 'fragrance-trade' ),
'b2b_process_7_text' => __( '按计划生产、检验并同步关键节点。', 'fragrance-trade' ),
'b2b_process_8_title' => __( '发货与售后', 'fragrance-trade' ),
'b2b_process_8_text' => __( '准备发货资料,保留已确认的项目档案。', 'fragrance-trade' ),
'b2b_show_projects' => true,
'b2b_projects_title' => __( '典型项目案例', 'fragrance-trade' ),
'b2b_projects_text' => __( '以下卡片说明不同类型的客户如何与工厂合作,不代表已验证的客户业绩。', 'fragrance-trade' ),
'b2b_project_1_title' => __( '新品牌首批产品', 'fragrance-trade' ),
'b2b_project_1_meta' => __( '从概念到首批产品', 'fragrance-trade' ),
'b2b_project_1_text' => __( '协调膜料选型、规格确定、样品制作和上市包装。', 'fragrance-trade' ),
'b2b_project_2_title' => __( '经销商贴牌定制', 'fragrance-trade' ),
'b2b_project_2_meta' => __( '规格驱动的定制开发', 'fragrance-trade' ),
'b2b_project_2_text' => __( '将渠道定位、目标成本和货架需求转化为可控的产品方案。', 'fragrance-trade' ),
'b2b_project_3_title' => __( '定制礼品装项目', 'fragrance-trade' ),
'b2b_project_3_meta' => __( '产品与包装协调', 'fragrance-trade' ),
'b2b_project_3_text' => __( '围绕交付窗口协调膜料、套装配置和礼品包装。', 'fragrance-trade' ),
'b2b_show_documents' => true,
'b2b_documents_title' => __( '文档与出口支持', 'fragrance-trade' ),
'b2b_documents_text' => __( '可提供的文件视产品、目的地和项目而定。下单前请确认所需文件清单。', 'fragrance-trade' ),
'b2b_document_1_title' => __( '产品规格书', 'fragrance-trade' ),
'b2b_document_1_text' => __( '已确认的膜料、规格和包装参考文件。', 'fragrance-trade' ),
'b2b_document_2_title' => __( '批次质检报告', 'fragrance-trade' ),
'b2b_document_2_text' => __( '按约定的项目要求维护的生产和检验记录。', 'fragrance-trade' ),
'b2b_document_3_title' => __( '材料证明文件', 'fragrance-trade' ),
'b2b_document_3_text' => __( '如适用且可提供,包括 MSDS 或 COA 等支持性文件。', 'fragrance-trade' ),
'b2b_document_4_title' => __( '出口贸易文件', 'fragrance-trade' ),
'b2b_document_4_text' => __( '按目的地需求协调装箱单、运输标识和出口信息。', 'fragrance-trade' ),
'b2b_show_faq' => true,
'b2b_faq_title' => __( '常见问题', 'fragrance-trade' ),
'b2b_faq_1_question' => __( '最低起订量是多少?', 'fragrance-trade' ),
'b2b_faq_1_answer' => __( '起订量取决于膜料、颜色、厚度和包装方案。请提交目标配置以获取准确答复。', 'fragrance-trade' ),
'b2b_faq_2_question' => __( '可以从现有颜色中选择吗?', 'fragrance-trade' ),
'b2b_faq_2_answer' => __( '现有颜色可缩短开发周期。所选膜料和颜色通过打样确认后进入量产。', 'fragrance-trade' ),
'b2b_faq_3_question' => __( '可以按我的参考样品生产吗?', 'fragrance-trade' ),
'b2b_faq_3_answer' => __( '参考样品可用于评估开发方向。精确匹配的可行性需评审后确认。', 'fragrance-trade' ),
'b2b_faq_4_question' => __( '打样需要多长时间?', 'fragrance-trade' ),
'b2b_faq_4_answer' => __( '时间取决于膜料调配、颜色开发和包装复杂度。评审需求后会提供项目时间表。', 'fragrance-trade' ),
'b2b_faq_5_question' => __( '膜料和包装可以定制吗?', 'fragrance-trade' ),
'b2b_faq_5_answer' => __( '项目可包含膜料选型、颜色、厚度、图案、标签和外包装选项,具体取决于数量和供应商可行性。', 'fragrance-trade' ),
'b2b_faq_6_question' => __( '量产前可以申请样品吗?', 'fragrance-trade' ),
'b2b_faq_6_answer' => __( '可以。打样范围、费用和交付方式按项目需求确认。', 'fragrance-trade' ),
'b2b_faq_7_question' => __( '报价需要提供哪些信息?', 'fragrance-trade' ),
'b2b_faq_7_answer' => __( '请提供联系方式、所需产品或服务及简要需求说明,其余规格可在后续跟进中补充。', 'fragrance-trade' ),
'b2b_faq_8_question' => __( '出口可以提供哪些文件?', 'fragrance-trade' ),
'b2b_faq_8_answer' => __( '文件清单取决于产品和目的地。请告知进口市场,以便下单前确认可提供的支持文件。', 'fragrance-trade' ),
'b2b_rfq_title' => __( '提交简单询价', 'fragrance-trade' ),
'b2b_rfq_text' => __( '提供一些基本信息,我们的项目团队将跟进详细规格、数量和包装需求。', 'fragrance-trade' ),
'b2b_rfq_button_label' => __( '发送询价', 'fragrance-trade' ),
'inquiry_email' => '',
'whatsapp' => '',
'facebook_url' => '',
'twitter_url' => '',
'youtube_url' => '',
'linkedin_url' => '',
'instagram_social_url' => '',
'footer_text' => __( '为全球品牌和采购商提供汽车贴膜定制制造服务。', 'fragrance-trade' ),
);
}
+85
View File
@@ -0,0 +1,85 @@
<?php
/** Reusable B2B theme helpers. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
function fragrance_trade_get_default( $key, $fallback = '' ) {
$defaults = fragrance_trade_defaults();
return array_key_exists( $key, $defaults ) ? $defaults[ $key ] : $fallback;
}
function fragrance_trade_get_mod( $key, $fallback = null ) {
$default = null === $fallback ? fragrance_trade_get_default( $key ) : $fallback;
return get_theme_mod( $key, $default );
}
function fragrance_trade_asset_uri( $relative_path ) {
return trailingslashit( get_template_directory_uri() ) . 'assets/' . ltrim( $relative_path, '/' );
}
function fragrance_trade_image_uri( $setting, $fallback_filename ) {
$image = fragrance_trade_get_mod( $setting, '' );
return $image ? $image : fragrance_trade_asset_uri( 'images/' . $fallback_filename );
}
function fragrance_trade_show_section( $setting ) {
return (bool) fragrance_trade_get_mod( $setting, true );
}
function fragrance_trade_fallback_menu( $args = array() ) {
$items = array(
'#intro' => __( '首页', 'fragrance-trade' ),
'#services' => __( '服务', 'fragrance-trade' ),
'#capabilities' => __( '产品', 'fragrance-trade' ),
'#factory' => __( '工厂', 'fragrance-trade' ),
'#quality' => __( '品质', 'fragrance-trade' ),
'#process' => __( '流程', 'fragrance-trade' ),
'#rfq' => __( '获取报价', 'fragrance-trade' ),
);
$class = isset( $args['menu_class'] ) ? $args['menu_class'] : 'navbar-nav';
echo '<ul class="' . esc_attr( $class ) . '">';
foreach ( $items as $anchor => $label ) {
$url = is_front_page() ? $anchor : home_url( '/' ) . $anchor;
echo '<li class="nav-item"><a class="nav-link p-0" href="' . esc_url( $url ) . '">' . esc_html( $label ) . '</a></li>';
}
echo '</ul>';
}
function fragrance_trade_whatsapp_number() {
return preg_replace( '/[^0-9]/', '', (string) fragrance_trade_get_mod( 'whatsapp', '' ) );
}
function fragrance_trade_inquiry_email() {
$email = sanitize_email( fragrance_trade_get_mod( 'inquiry_email', '' ) );
return is_email( $email ) ? $email : sanitize_email( get_option( 'admin_email' ) );
}
function fragrance_trade_get_inquiry_url( $project = '' ) {
$message = $project
? sprintf( __( '您好,我想咨询 %s 的 OEM/ODM 项目。', 'fragrance-trade' ), $project )
: __( '您好,我想咨询汽车贴膜定制项目。', 'fragrance-trade' );
$number = fragrance_trade_whatsapp_number();
if ( $number ) {
return add_query_arg( 'text', $message, 'https://wa.me/' . $number );
}
return 'mailto:' . antispambot( fragrance_trade_inquiry_email() ) . '?subject=' . rawurlencode( __( '汽车贴膜项目询价', 'fragrance-trade' ) ) . '&body=' . rawurlencode( $message );
}
function fragrance_trade_get_notice() {
if ( empty( $_GET['fragrance_notice'] ) ) {
return '';
}
return sanitize_key( wp_unslash( $_GET['fragrance_notice'] ) );
}
function fragrance_trade_notice_message( $code ) {
$messages = array(
'success' => __( '感谢您的提交,项目需求已发送。', 'fragrance-trade' ),
'invalid' => __( '请检查必填项后重新提交。', 'fragrance-trade' ),
'rate_limited' => __( '请稍候片刻再重新提交。', 'fragrance-trade' ),
'mail_failed' => __( '发送失败,请通过邮件或 WhatsApp 联系我们。', 'fragrance-trade' ),
);
return isset( $messages[ $code ] ) ? $messages[ $code ] : '';
}
+87
View File
@@ -0,0 +1,87 @@
<?php
/** Secure B2B RFQ handling. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
function fragrance_trade_post_value( $key ) {
if ( ! isset( $_POST[ $key ] ) || ! is_scalar( $_POST[ $key ] ) ) {
return '';
}
return (string) wp_unslash( $_POST[ $key ] );
}
function fragrance_trade_limit_text( $value, $length ) {
return function_exists( 'mb_substr' ) ? mb_substr( $value, 0, $length ) : substr( $value, 0, $length );
}
function fragrance_trade_form_redirect_url() {
$fallback = home_url( '/' );
$referer = wp_get_referer();
return wp_validate_redirect( $referer ? $referer : $fallback, $fallback );
}
function fragrance_trade_redirect_notice( $notice ) {
$url = remove_query_arg( 'fragrance_notice', fragrance_trade_form_redirect_url() );
$url = add_query_arg( 'fragrance_notice', sanitize_key( $notice ), $url );
wp_safe_redirect( $url . '#rfq' );
exit;
}
function fragrance_trade_is_rate_limited( $action ) {
$address = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : 'unknown';
$key = 'fragrance_' . sanitize_key( $action ) . '_' . substr( hash( 'sha256', $address . wp_salt( 'nonce' ) ), 0, 32 );
if ( get_transient( $key ) ) {
return true;
}
set_transient( $key, 1, MINUTE_IN_SECONDS );
return false;
}
function fragrance_trade_honeypot_filled() {
return '' !== trim( fragrance_trade_post_value( 'fragrance_website' ) );
}
function fragrance_trade_handle_rfq() {
check_admin_referer( 'fragrance_rfq', 'fragrance_rfq_nonce' );
if ( fragrance_trade_honeypot_filled() ) {
fragrance_trade_redirect_notice( 'invalid' );
}
if ( fragrance_trade_is_rate_limited( 'rfq' ) ) {
fragrance_trade_redirect_notice( 'rate_limited' );
}
$fields = array(
'name' => fragrance_trade_limit_text( sanitize_text_field( fragrance_trade_post_value( 'name' ) ), 100 ),
'email' => fragrance_trade_limit_text( sanitize_email( fragrance_trade_post_value( 'email' ) ), 190 ),
'company' => fragrance_trade_limit_text( sanitize_text_field( fragrance_trade_post_value( 'company' ) ), 150 ),
'whatsapp' => fragrance_trade_limit_text( sanitize_text_field( fragrance_trade_post_value( 'whatsapp' ) ), 100 ),
'product_type' => fragrance_trade_limit_text( sanitize_text_field( fragrance_trade_post_value( 'product_type' ) ), 150 ),
'message' => fragrance_trade_limit_text( sanitize_textarea_field( fragrance_trade_post_value( 'message' ) ), 2000 ),
);
if ( ! $fields['name'] || ! is_email( $fields['email'] ) || ! $fields['product_type'] || ! $fields['message'] ) {
fragrance_trade_redirect_notice( 'invalid' );
}
$labels = array(
'name' => __( '姓名', 'fragrance-trade' ), 'email' => __( '企业邮箱', 'fragrance-trade' ),
'company' => __( '公司名称', 'fragrance-trade' ), 'whatsapp' => __( 'WhatsApp 或电话', 'fragrance-trade' ),
'product_type' => __( '需求产品或服务', 'fragrance-trade' ), 'message' => __( '简要需求描述', 'fragrance-trade' ),
);
$body_lines = array();
foreach ( $labels as $key => $label ) {
$body_lines[] = $label . ': ' . ( $fields[ $key ] ? $fields[ $key ] : __( '未提供', 'fragrance-trade' ) );
}
$site_name = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
$safe_name = str_replace( array( "\r", "\n" ), ' ', $fields['name'] );
$safe_email = str_replace( array( "\r", "\n" ), '', $fields['email'] );
$context = $fields['company'] ? $fields['company'] : $fields['product_type'];
$subject = sprintf( '[%s] %s - %s', $site_name, __( '汽车贴膜项目询价', 'fragrance-trade' ), $context );
$headers = array( 'Content-Type: text/plain; charset=UTF-8', 'Reply-To: ' . $safe_name . ' <' . $safe_email . '>' );
$sent = wp_mail( fragrance_trade_inquiry_email(), $subject, implode( "\n\n", $body_lines ), $headers );
fragrance_trade_redirect_notice( $sent ? 'success' : 'mail_failed' );
}
add_action( 'admin_post_fragrance_rfq', 'fragrance_trade_handle_rfq' );
add_action( 'admin_post_nopriv_fragrance_rfq', 'fragrance_trade_handle_rfq' );
+65
View File
@@ -0,0 +1,65 @@
<?php
/**
* Theme setup and frontend assets.
*
* @package Fragrance_Trade
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/** Register theme features and menus. */
function fragrance_trade_setup() {
load_theme_textdomain( 'fragrance-trade', get_template_directory() . '/languages' );
add_theme_support( 'title-tag' );
add_theme_support( 'custom-logo', array( 'height' => 96, 'width' => 260, 'flex-height' => true, 'flex-width' => true ) );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'responsive-embeds' );
add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption', 'style', 'script' ) );
add_image_size( 'fragrance-capability', 760, 720, true );
register_nav_menus(
array(
'primary' => __( '主导航', 'fragrance-trade' ),
)
);
}
add_action( 'after_setup_theme', 'fragrance_trade_setup' );
/**
* Return a cache-busting version for a local theme asset.
*
* @param string $relative_path Path relative to the theme root.
* @param string $fallback Version used when the file cannot be read.
* @return string
*/
function fragrance_trade_asset_version( $relative_path, $fallback ) {
$file = get_theme_file_path( '/' . ltrim( $relative_path, '/' ) );
return file_exists( $file ) ? (string) filemtime( $file ) : $fallback;
}
/** Load theme styles and scripts through the WordPress dependency system. */
function fragrance_trade_enqueue_assets() {
$version = wp_get_theme()->get( 'Version' );
wp_enqueue_style( 'fragrance-bootstrap', 'https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0-alpha3/css/bootstrap.min.css', array(), '5.3.0-alpha3' );
wp_enqueue_style( 'fragrance-fonts', 'https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@200;300;400;500;600;700&family=Jost:wght@200;300;400;500&family=Noto+Sans+SC:wght@300;400;500;700&display=swap', array(), null );
wp_enqueue_style( 'fragrance-normalize', get_template_directory_uri() . '/assets/css/normalize.css', array(), fragrance_trade_asset_version( 'assets/css/normalize.css', $version ) );
wp_enqueue_style( 'fragrance-vendor', get_template_directory_uri() . '/assets/css/vendor.css', array(), fragrance_trade_asset_version( 'assets/css/vendor.css', $version ) );
wp_enqueue_style( 'fragrance-base', get_stylesheet_uri(), array( 'fragrance-bootstrap', 'fragrance-vendor' ), fragrance_trade_asset_version( 'style.css', $version ) );
wp_enqueue_style( 'fragrance-theme', get_template_directory_uri() . '/assets/css/theme.css', array( 'fragrance-base' ), fragrance_trade_asset_version( 'assets/css/theme.css', $version ) );
wp_enqueue_script( 'fragrance-bootstrap', 'https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0-alpha3/js/bootstrap.bundle.min.js', array(), '5.3.0-alpha3', true );
wp_enqueue_script( 'fragrance-plugins', get_template_directory_uri() . '/assets/js/plugins.js', array( 'jquery' ), fragrance_trade_asset_version( 'assets/js/plugins.js', $version ), true );
wp_enqueue_script( 'fragrance-theme', get_template_directory_uri() . '/assets/js/theme.js', array( 'jquery', 'fragrance-bootstrap', 'fragrance-plugins' ), fragrance_trade_asset_version( 'assets/js/theme.js', $version ), true );
wp_localize_script(
'fragrance-theme',
'fragranceTrade',
array(
'motionQuery' => '(prefers-reduced-motion: reduce)',
)
);
}
add_action( 'wp_enqueue_scripts', 'fragrance_trade_enqueue_assets' );
+17
View File
@@ -0,0 +1,17 @@
<?php
/** Main fallback template. @package Fragrance_Trade */
get_header();
?>
<main id="primary" class="site-main container py-5 fragrance-content-area">
<?php if ( have_posts() ) : ?>
<div class="row g-5">
<?php while ( have_posts() ) : the_post(); ?>
<div class="col-12"><?php get_template_part( 'template-parts/content', get_post_type() ); ?></div>
<?php endwhile; ?>
</div>
<?php the_posts_pagination(); ?>
<?php else : ?>
<?php get_template_part( 'template-parts/content', 'none' ); ?>
<?php endif; ?>
</main>
<?php get_footer(); ?>
+22
View File
@@ -0,0 +1,22 @@
<?php
/**
* About the shop page template.
*
* @package Fragrance_Trade
*/
get_header();
?>
<main id="primary" class="site-main">
<?php while ( have_posts() ) : the_post(); ?>
<article class="container py-5">
<header class="mb-4">
<h1><?php the_title(); ?></h1>
</header>
<div class="about-content"><?php the_content(); ?></div>
<div class="text-center mt-5">
<a href="<?php echo esc_url( home_url( '/contact/' ) ); ?>" class="btn btn-b2b-primary btn-lg"><?php esc_html_e( '预约到店', 'fragrance-trade' ); ?></a>
</div>
</article>
<?php endwhile; ?>
</main>
<?php get_footer(); ?>
+50
View File
@@ -0,0 +1,50 @@
<?php
/**
* Booking / contact page template. Reuses the secure RFQ handler.
*
* @package Fragrance_Trade
*/
get_header();
$notice = fragrance_trade_get_notice();
$notice_message = fragrance_trade_notice_message( $notice );
?>
<main id="primary" class="site-main">
<section id="rfq" class="b2b-section rfq-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 esc_html_e( '预约您的贴膜服务', 'fragrance-trade' ); ?></h2>
<p class="section-lead"><?php esc_html_e( '留下车型与需求,我们会尽快联系您,确认到店施工时间。', 'fragrance-trade' ); ?></p>
<div class="rfq-direct">
<h3><?php esc_html_e( '希望直接联系?', 'fragrance-trade' ); ?></h3>
<a href="<?php echo esc_url( fragrance_trade_get_inquiry_url() ); ?>"><?php esc_html_e( '通过邮件或 WhatsApp 联系我们', 'fragrance-trade' ); ?></a>
</div>
</div>
<div class="col-lg-8">
<div class="rfq-form-card">
<div class="fragrance-form-status" aria-live="polite">
<?php if ( $notice_message ) : ?><p class="notice-<?php echo esc_attr( $notice ); ?>"><?php echo esc_html( $notice_message ); ?></p><?php endif; ?>
</div>
<form action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" method="post">
<input type="hidden" name="action" value="fragrance_rfq">
<?php wp_nonce_field( 'fragrance_rfq', 'fragrance_rfq_nonce' ); ?>
<div class="row g-3">
<div class="col-sm-6"><label for="rfq-name"><?php esc_html_e( '姓名 *', 'fragrance-trade' ); ?></label><input id="rfq-name" class="form-control" type="text" name="name" required maxlength="100" autocomplete="name"></div>
<div class="col-sm-6"><label for="rfq-email"><?php esc_html_e( '邮箱 *', 'fragrance-trade' ); ?></label><input id="rfq-email" class="form-control" type="email" name="email" required maxlength="190" autocomplete="email"></div>
<div class="col-sm-6"><label for="rfq-car"><?php esc_html_e( '车型 / 车牌(选填)', 'fragrance-trade' ); ?></label><input id="rfq-car" class="form-control" type="text" name="company" maxlength="150"></div>
<div class="col-sm-6"><label for="rfq-whatsapp"><?php esc_html_e( 'WhatsApp 或电话', 'fragrance-trade' ); ?></label><input id="rfq-whatsapp" class="form-control" type="text" name="whatsapp" maxlength="100" autocomplete="tel"></div>
<div class="col-12"><label for="rfq-product-type"><?php esc_html_e( '想做的项目 / 膜种 *', 'fragrance-trade' ); ?></label><input id="rfq-product-type" class="form-control" type="text" name="product_type" required maxlength="150" data-rfq-product-field></div>
<div class="col-12"><label for="rfq-message"><?php esc_html_e( '简要需求描述 *', 'fragrance-trade' ); ?></label><textarea id="rfq-message" class="form-control" name="message" rows="4" required maxlength="2000" placeholder="<?php esc_attr_e( '请描述您的车型与需求。', 'fragrance-trade' ); ?>"></textarea></div>
</div>
<div class="fragrance-honeypot" aria-hidden="true"><label for="rfq-website">Website</label><input id="rfq-website" type="text" name="fragrance_website" tabindex="-1" autocomplete="off"></div>
<p class="rfq-privacy-note"><?php esc_html_e( '我们仅会使用这些信息回复您的预约。', 'fragrance-trade' ); ?></p>
<button type="submit" class="btn btn-b2b-primary"><?php esc_html_e( '提交预约', 'fragrance-trade' ); ?></button>
</form>
</div>
</div>
</div>
</div>
</section>
</main>
<?php get_footer(); ?>
+17
View File
@@ -0,0 +1,17 @@
<?php
/**
* FAQ page template.
*
* @package Fragrance_Trade
*/
get_header();
?>
<main id="primary" class="site-main">
<header class="page-header container py-5">
<h1><?php the_title(); ?></h1>
</header>
<div class="container pb-5">
<?php get_template_part( 'template-parts/home/faq' ); ?>
</div>
</main>
<?php get_footer(); ?>
+10
View File
@@ -0,0 +1,10 @@
<?php
/** Page template. @package Fragrance_Trade */
get_header();
?>
<main id="primary" class="site-main container py-5 fragrance-content-area">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'template-parts/content', 'page' ); ?>
<?php endwhile; ?>
</main>
<?php get_footer(); ?>
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 374 KiB

+34
View File
@@ -0,0 +1,34 @@
<?php
/**
* Single case template.
*
* @package Fragrance_Trade
*/
get_header();
?>
<main id="primary" class="site-main">
<?php while ( have_posts() ) : the_post(); ?>
<article class="container py-5">
<nav class="breadcrumb-nav mb-4" aria-label="<?php esc_attr_e( '面包屑', 'fragrance-trade' ); ?>">
<a href="<?php echo esc_url( home_url( '/cases/' ) ); ?>"><?php esc_html_e( '案例作品', 'fragrance-trade' ); ?></a>
<span aria-hidden="true"> / </span>
<span><?php the_title(); ?></span>
</nav>
<?php if ( has_post_thumbnail() ) : ?>
<div class="mb-4"><?php the_post_thumbnail( 'large', array( 'class' => 'img-fluid rounded' ) ); ?></div>
<?php endif; ?>
<header class="mb-4">
<h1><?php the_title(); ?></h1>
<?php
$types = get_the_terms( get_the_ID(), 'case_type' );
if ( $types && ! is_wp_error( $types ) ) :
?>
<p class="case-types"><?php echo esc_html( implode( ', ', wp_list_pluck( $types, 'name' ) ) ); ?></p>
<?php endif; ?>
</header>
<div class="case-content"><?php the_content(); ?></div>
<a href="<?php echo esc_url( home_url( '/contact/' ) ); ?>" class="btn btn-b2b-primary mt-3"><?php esc_html_e( '预约同款施工', 'fragrance-trade' ); ?></a>
</article>
<?php endwhile; ?>
</main>
<?php get_footer(); ?>
+34
View File
@@ -0,0 +1,34 @@
<?php
/**
* Single service template.
*
* @package Fragrance_Trade
*/
get_header();
?>
<main id="primary" class="site-main">
<?php while ( have_posts() ) : the_post(); ?>
<?php
$image = get_post_meta( get_the_ID(), '_service_image', true );
$img = $image ? $image : fragrance_trade_asset_uri( 'products/placeholder-01.svg' );
?>
<article class="container py-5">
<nav class="breadcrumb-nav mb-4" aria-label="<?php esc_attr_e( '面包屑', 'fragrance-trade' ); ?>">
<a href="<?php echo esc_url( home_url( '/services/' ) ); ?>"><?php esc_html_e( '服务项目', 'fragrance-trade' ); ?></a>
<span aria-hidden="true"> / </span>
<span><?php the_title(); ?></span>
</nav>
<div class="row g-5 align-items-center">
<div class="col-lg-6">
<img src="<?php echo esc_url( $img ); ?>" alt="<?php the_title_attribute(); ?>" class="img-fluid rounded">
</div>
<div class="col-lg-6">
<h1><?php the_title(); ?></h1>
<div class="service-content"><?php the_content(); ?></div>
<a href="<?php echo esc_url( home_url( '/contact/?service=' . rawurlencode( get_the_title() ) ) ); ?>" class="btn btn-b2b-primary mt-3"><?php esc_html_e( '预约这项服务', 'fragrance-trade' ); ?></a>
</div>
</div>
</article>
<?php endwhile; ?>
</main>
<?php get_footer(); ?>
+12
View File
@@ -0,0 +1,12 @@
<?php
/** Single post template. @package Fragrance_Trade */
get_header();
?>
<main id="primary" class="site-main container py-5 fragrance-content-area">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'template-parts/content', get_post_type() ); ?>
<?php the_post_navigation(); ?>
<?php if ( comments_open() || get_comments_number() ) : comments_template(); endif; ?>
<?php endwhile; ?>
</main>
<?php get_footer(); ?>
+14
View File
@@ -0,0 +1,14 @@
/*
Theme Name: B2B Trade
Theme URI: https://example.com/b2b-trade/
Author: B2B Trade
Description: A responsive OEM/ODM private-label car film manufacturer B2B theme focused on manufacturing capabilities, quality proof and qualified RFQ conversion.
Version: 2.0.0
Requires at least: 6.5
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fragrance-trade
Tags: custom-logo, custom-menu, featured-images, translation-ready, one-column
*/
+8
View File
@@ -0,0 +1,8 @@
<?php
/** Empty-loop content. @package Fragrance_Trade */
?>
<section class="no-results not-found text-center py-5">
<h1 class="page-title"><?php esc_html_e( '未找到内容', 'fragrance-trade' ); ?></h1>
<p><?php esc_html_e( '请尝试其他搜索词或返回首页。', 'fragrance-trade' ); ?></p>
<?php get_search_form(); ?>
</section>
+3
View File
@@ -0,0 +1,3 @@
<?php
/** Page content. @package Fragrance_Trade */
get_template_part( 'template-parts/content' );
+22
View File
@@ -0,0 +1,22 @@
<?php
/** Generic loop content. @package Fragrance_Trade */
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'fragrance-entry' ); ?>>
<header class="entry-header mb-3">
<?php if ( is_singular() ) : ?>
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<?php else : ?>
<?php the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); ?>
<?php endif; ?>
<?php if ( 'post' === get_post_type() ) : ?>
<div class="entry-meta text-secondary"><?php echo esc_html( get_the_date() ); ?></div>
<?php endif; ?>
</header>
<?php if ( has_post_thumbnail() ) : ?>
<div class="entry-thumbnail mb-4"><?php the_post_thumbnail( 'large', array( 'class' => 'img-fluid' ) ); ?></div>
<?php endif; ?>
<div class="entry-content">
<?php is_singular() ? the_content() : the_excerpt(); ?>
<?php wp_link_pages(); ?>
</div>
</article>
+38
View File
@@ -0,0 +1,38 @@
<?php
/** Case teaser on the homepage. @package Fragrance_Trade */
$case_query = new WP_Query(
array(
'post_type' => 'case',
'posts_per_page' => 6,
'post_status' => 'publish',
)
);
?>
<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><?php esc_html_e( '真实车主、真实车型,来自门店一线的施工案例。', 'fragrance-trade' ); ?></p>
</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( '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>
<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>
</div>
<?php else : ?>
<p class="text-center mt-4 mb-0"><?php esc_html_e( '案例即将上线,敬请期待。', 'fragrance-trade' ); ?></p>
<?php endif; ?>
</div>
</section>
+10
View File
@@ -0,0 +1,10 @@
<?php
/** Booking call-to-action band on the homepage. @package Fragrance_Trade */
?>
<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>
</div>
</section>
+7
View File
@@ -0,0 +1,7 @@
<?php /** Customization map. @package Fragrance_Trade */ ?>
<section id="customization" class="b2b-section customization-section">
<div class="container">
<div class="row g-5 align-items-start"><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_custom_title' ) ); ?></h2><p class="section-lead"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_custom_text' ) ); ?></p><a href="#rfq" class="btn btn-b2b-primary mt-3"><?php esc_html_e( '提交产品需求', 'fragrance-trade' ); ?></a></div>
<div class="col-lg-7"><div class="customization-grid"><?php for ( $index = 1; $index <= 8; $index++ ) : ?><div class="customization-item"><span><?php echo esc_html( str_pad( (string) $index, 2, '0', STR_PAD_LEFT ) ); ?></span><h3><?php echo esc_html( fragrance_trade_get_mod( 'b2b_custom_' . $index . '_title' ) ); ?></h3></div><?php endfor; ?></div></div></div>
</div>
</section>
+4
View File
@@ -0,0 +1,4 @@
<?php /** Documentation support. @package Fragrance_Trade */ 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>
</section>
+12
View File
@@ -0,0 +1,12 @@
<?php
/** Factory proof section. @package Fragrance_Trade */
$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">
<div class="container">
<div class="row g-5 align-items-center">
<div class="col-lg-5"><p class="section-eyebrow"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_factory_eyebrow' ) ); ?></p><h2><?php echo esc_html( fragrance_trade_get_mod( 'b2b_factory_title' ) ); ?></h2><p class="section-lead"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_factory_text' ) ); ?></p><ul class="factory-points list-unstyled mt-4"><?php for ( $index = 1; $index <= 4; $index++ ) : ?><li><span aria-hidden="true">✓</span><?php echo esc_html( fragrance_trade_get_mod( 'b2b_factory_point_' . $index ) ); ?></li><?php endfor; ?></ul></div>
<div class="col-lg-7"><div class="factory-gallery"><?php for ( $index = 1; $index <= 4; $index++ ) : ?><figure><img src="<?php echo esc_url( fragrance_trade_image_uri( 'b2b_factory_image_' . $index, $factory_fallbacks[ $index - 1 ] ) ); ?>" alt="<?php echo esc_attr( sprintf( __( '工厂实景 %d', 'fragrance-trade' ), $index ) ); ?>" loading="lazy"></figure><?php endfor; ?></div></div>
</div>
</div>
</section>
+2
View File
@@ -0,0 +1,2 @@
<?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>
+24
View File
@@ -0,0 +1,24 @@
<?php
/** B2B factory hero. @package Fragrance_Trade */
$title = fragrance_trade_get_mod( 'b2b_hero_title' );
?>
<section id="intro" class="b2b-hero">
<div class="container">
<div class="row">
<div class="col-xl-10 col-lg-11">
<p class="section-eyebrow"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_hero_eyebrow' ) ); ?></p>
<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" 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-secondary" 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>
</div>
<ul class="hero-proof-list list-unstyled d-flex flex-wrap gap-3 mt-5 mb-0" 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>
</div>
</section>
+5
View File
@@ -0,0 +1,5 @@
<?php /** OEM/ODM process. @package Fragrance_Trade */ ?>
<section id="process" class="b2b-section process-section">
<div class="container"><div class="section-heading row align-items-end g-4"><div class="col-lg-7"><p class="section-eyebrow"><?php esc_html_e( '从需求到交付', 'fragrance-trade' ); ?></p><h2><?php echo esc_html( fragrance_trade_get_mod( 'b2b_process_title' ) ); ?></h2></div><div class="col-lg-5"><p><?php echo esc_html( fragrance_trade_get_mod( 'b2b_process_text' ) ); ?></p></div></div>
<div class="process-grid mt-5"><?php for ( $index = 1; $index <= 8; $index++ ) : ?><article class="process-step"><span><?php echo esc_html( str_pad( (string) $index, 2, '0', STR_PAD_LEFT ) ); ?></span><h3><?php echo esc_html( fragrance_trade_get_mod( 'b2b_process_' . $index . '_title' ) ); ?></h3><p><?php echo esc_html( fragrance_trade_get_mod( 'b2b_process_' . $index . '_text' ) ); ?></p></article><?php endfor; ?></div></div>
</section>
+25
View File
@@ -0,0 +1,25 @@
<?php
/** Factory-produced perfume reference cards. @package Fragrance_Trade */
$fallbacks = array(
'products/placeholder-01.svg',
'products/placeholder-02.svg',
'products/placeholder-03.svg',
'products/placeholder-04.svg',
'products/placeholder-05.svg',
'products/placeholder-06.svg',
'products/placeholder-07.svg',
);
?>
<section id="capabilities" class="b2b-section capabilities-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 echo esc_html( fragrance_trade_get_mod( 'b2b_products_title' ) ); ?></h2><p><?php echo esc_html( fragrance_trade_get_mod( 'b2b_products_text' ) ); ?></p></div>
<div class="capability-grid mt-5">
<?php for ( $index = 1; $index <= count( $fallbacks ); $index++ ) : $title = fragrance_trade_get_mod( 'b2b_product_' . $index . '_title' ); ?>
<article class="capability-card">
<div class="capability-image"><img src="<?php echo esc_url( fragrance_trade_image_uri( 'b2b_product_' . $index . '_image', $fallbacks[ $index - 1 ] ) ); ?>" alt="<?php echo esc_attr( $title ); ?>" class="img-fluid" width="960" height="960" loading="lazy" decoding="async"></div>
<div class="capability-body"><p class="capability-label"><?php esc_html_e( '定制生产参考', 'fragrance-trade' ); ?></p><h3><?php echo esc_html( $title ); ?></h3><p><?php echo esc_html( fragrance_trade_get_mod( 'b2b_product_' . $index . '_text' ) ); ?></p><p class="capability-specs"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_product_' . $index . '_specs' ) ); ?></p><a href="#rfq" class="btn btn-b2b-outline" data-rfq-product="<?php echo esc_attr( $title ); ?>"><?php esc_html_e( '咨询类似项目', 'fragrance-trade' ); ?></a></div>
</article>
<?php endfor; ?>
</div>
</div>
</section>
+5
View File
@@ -0,0 +1,5 @@
<?php /** Typical buyer project scenarios. @package Fragrance_Trade */ if ( ! fragrance_trade_show_section( 'b2b_show_projects' ) ) { return; } ?>
<section id="projects" class="b2b-section projects-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 echo esc_html( fragrance_trade_get_mod( 'b2b_projects_title' ) ); ?></h2><p><?php echo esc_html( fragrance_trade_get_mod( 'b2b_projects_text' ) ); ?></p></div>
<div class="project-grid mt-5"><?php for ( $index = 1; $index <= 3; $index++ ) : ?><article class="project-card"><p class="project-meta"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_project_' . $index . '_meta' ) ); ?></p><h3><?php echo esc_html( fragrance_trade_get_mod( 'b2b_project_' . $index . '_title' ) ); ?></h3><p><?php echo esc_html( fragrance_trade_get_mod( 'b2b_project_' . $index . '_text' ) ); ?></p><a href="#rfq" class="text-link"><?php esc_html_e( '咨询类似项目', 'fragrance-trade' ); ?> <span aria-hidden="true">→</span></a></article><?php endfor; ?></div></div>
</section>
+5
View File
@@ -0,0 +1,5 @@
<?php /** Quality control stages. @package Fragrance_Trade */ ?>
<section id="quality" class="b2b-section quality-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 echo esc_html( fragrance_trade_get_mod( 'b2b_quality_title' ) ); ?></h2><p><?php echo esc_html( fragrance_trade_get_mod( 'b2b_quality_text' ) ); ?></p></div>
<div class="quality-grid mt-5"><?php for ( $index = 1; $index <= 6; $index++ ) : ?><article class="quality-card"><span class="quality-number"><?php echo esc_html( str_pad( (string) $index, 2, '0', STR_PAD_LEFT ) ); ?></span><h3><?php echo esc_html( fragrance_trade_get_mod( 'b2b_quality_' . $index . '_title' ) ); ?></h3><p><?php echo esc_html( fragrance_trade_get_mod( 'b2b_quality_' . $index . '_text' ) ); ?></p></article><?php endfor; ?></div></div>
</section>
+42
View File
@@ -0,0 +1,42 @@
<?php
/** Compact B2B inquiry form. @package Fragrance_Trade */
$notice = fragrance_trade_get_notice();
$notice_message = fragrance_trade_notice_message( $notice );
?>
<section id="rfq" class="b2b-section rfq-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_rfq_title' ) ); ?></h2>
<p class="section-lead"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_rfq_text' ) ); ?></p>
<div class="rfq-direct">
<h3><?php esc_html_e( '希望直接联系?', 'fragrance-trade' ); ?></h3>
<a href="<?php echo esc_url( fragrance_trade_get_inquiry_url() ); ?>"><?php esc_html_e( '通过邮件或 WhatsApp 联系我们的项目团队', 'fragrance-trade' ); ?></a>
</div>
</div>
<div class="col-lg-8">
<div class="rfq-form-card">
<div class="fragrance-form-status" aria-live="polite">
<?php if ( $notice_message ) : ?><p class="notice-<?php echo esc_attr( $notice ); ?>"><?php echo esc_html( $notice_message ); ?></p><?php endif; ?>
</div>
<form action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" method="post">
<input type="hidden" name="action" value="fragrance_rfq">
<?php wp_nonce_field( 'fragrance_rfq', 'fragrance_rfq_nonce' ); ?>
<div class="row g-3">
<div class="col-sm-6"><label for="rfq-name"><?php esc_html_e( '姓名 *', 'fragrance-trade' ); ?></label><input id="rfq-name" class="form-control" type="text" name="name" required maxlength="100" autocomplete="name"></div>
<div class="col-sm-6"><label for="rfq-email"><?php esc_html_e( '企业邮箱 *', 'fragrance-trade' ); ?></label><input id="rfq-email" class="form-control" type="email" name="email" required maxlength="190" autocomplete="email"></div>
<div class="col-sm-6"><label for="rfq-company"><?php esc_html_e( '公司名称', 'fragrance-trade' ); ?></label><input id="rfq-company" class="form-control" type="text" name="company" maxlength="150" autocomplete="organization"></div>
<div class="col-sm-6"><label for="rfq-whatsapp"><?php esc_html_e( 'WhatsApp 或电话', 'fragrance-trade' ); ?></label><input id="rfq-whatsapp" class="form-control" type="text" name="whatsapp" maxlength="100" autocomplete="tel"></div>
<div class="col-12"><label for="rfq-product-type"><?php esc_html_e( '需求产品或服务 *', 'fragrance-trade' ); ?></label><input id="rfq-product-type" class="form-control" type="text" name="product_type" required maxlength="150" data-rfq-product-field></div>
<div class="col-12"><label for="rfq-message"><?php esc_html_e( '简要需求描述 *', 'fragrance-trade' ); ?></label><textarea id="rfq-message" class="form-control" name="message" rows="4" required maxlength="2000" placeholder="<?php esc_attr_e( '请描述您的需求。', 'fragrance-trade' ); ?>"></textarea></div>
</div>
<div class="fragrance-honeypot" aria-hidden="true"><label for="rfq-website">Website</label><input id="rfq-website" type="text" name="fragrance_website" tabindex="-1" autocomplete="off"></div>
<p class="rfq-privacy-note"><?php esc_html_e( '我们仅会使用这些信息回复您的询价。', 'fragrance-trade' ); ?></p>
<button type="submit" class="btn btn-b2b-primary"><?php echo esc_html( fragrance_trade_get_mod( 'b2b_rfq_button_label' ) ); ?></button>
</form>
</div>
</div>
</div>
</div>
</section>
+49
View File
@@ -0,0 +1,49 @@
<?php
/** Service teaser on the homepage. @package Fragrance_Trade */
$service_query = new WP_Query(
array(
'post_type' => 'service',
'posts_per_page' => 6,
'post_status' => 'publish',
)
);
if ( ! $service_query->have_posts() ) {
return;
}
?>
<section id="services" class="b2b-section services-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><?php esc_html_e( '从隐形车衣到改色与隔热,专业施工,按需定制。', 'fragrance-trade' ); ?></p>
</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 );
?>
<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-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>
</div>
</article>
<?php
$count++;
endwhile;
wp_reset_postdata();
?>
</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>
</div>
</div>
</section>
+14
View File
@@ -0,0 +1,14 @@
<?php /** OEM/ODM services. @package Fragrance_Trade */ ?>
<section id="services" class="b2b-section services-section">
<div class="container">
<div class="section-heading row align-items-end g-4">
<div class="col-lg-7"><p class="section-eyebrow"><?php esc_html_e( '合作模式', 'fragrance-trade' ); ?></p><h2><?php echo esc_html( fragrance_trade_get_mod( 'b2b_services_title' ) ); ?></h2></div>
<div class="col-lg-5"><p><?php echo esc_html( fragrance_trade_get_mod( 'b2b_services_text' ) ); ?></p></div>
</div>
<div class="row g-4 mt-4">
<?php for ( $index = 1; $index <= 4; $index++ ) : ?>
<div class="col-md-6 col-xl-3"><article class="service-card h-100"><span class="card-index">0<?php echo esc_html( $index ); ?></span><h3><?php echo esc_html( fragrance_trade_get_mod( 'b2b_service_' . $index . '_title' ) ); ?></h3><p><?php echo esc_html( fragrance_trade_get_mod( 'b2b_service_' . $index . '_text' ) ); ?></p><a href="#rfq" class="text-link"><?php esc_html_e( '了解此服务', 'fragrance-trade' ); ?> <span aria-hidden="true">→</span></a></article></div>
<?php endfor; ?>
</div>
</div>
</section>
+14
View File
@@ -0,0 +1,14 @@
<?php /** Factory trust strip. @package Fragrance_Trade */ ?>
<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>
<div class="row g-0">
<?php for ( $index = 1; $index <= 4; $index++ ) : ?>
<div class="col-6 col-lg-3 trust-metric">
<strong><?php echo esc_html( fragrance_trade_get_mod( 'b2b_metric_' . $index . '_value' ) ); ?></strong>
<span><?php echo esc_html( fragrance_trade_get_mod( 'b2b_metric_' . $index . '_label' ) ); ?></span>
</div>
<?php endfor; ?>
</div>
</div>
</section>
+9
View File
@@ -0,0 +1,9 @@
<?php
/** Factory tour video. @package Fragrance_Trade */
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 );
?>
<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="#rfq"><?php esc_html_e( '获取实拍工厂素材', 'fragrance-trade' ); ?></a><?php endif; ?></div></div></div>
</section>