feat: release B2B Trade theme 2.1.0
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
<?php
|
||||
/** Service teaser on the homepage. @package Fragrance_Trade */
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$service_query = new WP_Query(
|
||||
array(
|
||||
'post_type' => 'service',
|
||||
'posts_per_page' => 6,
|
||||
'post_status' => 'publish',
|
||||
'no_found_rows' => true,
|
||||
)
|
||||
);
|
||||
if ( ! $service_query->have_posts() ) {
|
||||
@@ -15,24 +20,23 @@ if ( ! $service_query->have_posts() ) {
|
||||
<div class="container">
|
||||
<div class="section-heading text-center mx-auto">
|
||||
<p class="section-eyebrow"><?php esc_html_e( '服务项目', 'fragrance-trade' ); ?></p>
|
||||
<h2><?php esc_html_e( '为您的爱车提供的贴膜服务', 'fragrance-trade' ); ?></h2>
|
||||
<h2><?php esc_html_e( '按车型与需求选择贴膜方案', 'fragrance-trade' ); ?></h2>
|
||||
</div>
|
||||
<div class="capability-grid mt-5">
|
||||
<?php
|
||||
$count = 1;
|
||||
while ( $service_query->have_posts() ) :
|
||||
$service_query->the_post();
|
||||
$image = get_post_meta( get_the_ID(), '_service_image', true );
|
||||
$fallback = 'products/placeholder-0' . ( $count < 10 ? $count : 1 ) . '.svg';
|
||||
$img = $image ? $image : fragrance_trade_asset_uri( $fallback );
|
||||
$image = get_post_meta( get_the_ID(), '_service_image', true );
|
||||
$fallback = 'images/products/placeholder-0' . ( $count < 10 ? $count : 1 ) . '.svg';
|
||||
?>
|
||||
<article class="capability-card">
|
||||
<div class="capability-image"><a href="<?php the_permalink(); ?>"><img src="<?php echo esc_url( $img ); ?>" alt="<?php the_title_attribute(); ?>" class="img-fluid" loading="lazy" decoding="async"></a></div>
|
||||
<div class="capability-image"><a href="<?php the_permalink(); ?>"><?php if ( has_post_thumbnail() ) : ?><?php the_post_thumbnail( 'fragrance-capability', array( 'class' => 'img-fluid', 'loading' => 'lazy', 'decoding' => 'async' ) ); ?><?php else : ?><img src="<?php echo esc_url( $image ? $image : fragrance_trade_asset_uri( $fallback ) ); ?>" alt="<?php the_title_attribute(); ?>" class="img-fluid" loading="lazy" decoding="async"><?php endif; ?></a></div>
|
||||
<div class="capability-body">
|
||||
<p class="capability-label"><?php esc_html_e( '贴膜服务', 'fragrance-trade' ); ?></p>
|
||||
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
|
||||
<p><?php echo esc_html( get_the_excerpt() ); ?></p>
|
||||
<a href="<?php echo esc_url( home_url( '/contact/?service=' . rawurlencode( get_the_title() ) ) ); ?>" class="btn btn-b2b-outline"><?php esc_html_e( '预约这项服务', 'fragrance-trade' ); ?></a>
|
||||
<a href="<?php echo esc_url( home_url( '/contact/' ) ); ?>" class="btn btn-b2b-outline"><?php esc_html_e( '联系门店', 'fragrance-trade' ); ?></a>
|
||||
</div>
|
||||
</article>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user