- CPT: service(服务项目) + case(案例作品集) + case_type 分类 - 页面: 关于门店/常见问题/预约联系 + archive/single 模板 - 首页精简为 hero+trust+service-teaser+case-teaser+cta - 主题激活自动迁移 Customizer 产品数据为 service 文章 - 预约表单: nonce+honeypot+rate-limit, URL 参数预填服务 - 联系页: 门店地址/电话/营业时间/百度地图导航 - Customizer 面板改为门店语境(13 板块) - header CTA 改为预约, helpers 更新为门店口径 - README.md 全面更新为门店多页面架构文档
38 lines
1.5 KiB
PHP
38 lines
1.5 KiB
PHP
<?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>
|
|
</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>
|