fix: styled city cards on region pages; regions follow All Tours in the menu
- Region page city list uses the design's destination rail (dcard) instead of the unstyled pre-reskin card template - Header menu: structure regions are inserted after the top-level link to the tours archive instead of at the end - Plugin 1.9.2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,19 +31,45 @@ $vc_after_hero = '';
|
||||
if ( $vc_cities ) {
|
||||
ob_start();
|
||||
?>
|
||||
<section class="vc-section vc-section--destinations">
|
||||
<div class="vc-container">
|
||||
<header class="vc-section__head vc-reveal">
|
||||
<?php // Same destination rail as the homepage's Top Destinations (VC_Sections). ?>
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="sec-head">
|
||||
<?php /* translators: %s: region name. */ ?>
|
||||
<h2 class="vc-section__title"><?php echo esc_html( sprintf( __( 'Cities in %s', 'viator-collector' ), $vc_name ) ); ?></h2>
|
||||
</header>
|
||||
<div class="vc-destination-grid">
|
||||
<?php
|
||||
foreach ( $vc_cities as $vc_city ) {
|
||||
echo vc_get_template( 'card-destination.php', array( 'term' => $vc_city ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
?>
|
||||
<h2 class="sec-head__title"><?php echo esc_html( sprintf( __( 'Cities in %s', 'viator-collector' ), $vc_name ) ); ?></h2>
|
||||
<div class="sec-head__actions">
|
||||
<div class="rail-nav">
|
||||
<button class="btn btn--ghost rail-nav__btn" type="button" data-rail-prev="vcRailRegion" aria-label="<?php echo esc_attr__( 'Previous', 'viator-collector' ); ?>"><?php echo vc_icon( 'arrow-left' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></button>
|
||||
<button class="btn btn--ghost rail-nav__btn" type="button" data-rail-next="vcRailRegion" aria-label="<?php echo esc_attr__( 'Next', 'viator-collector' ); ?>"><?php echo vc_icon( 'arrow-right' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="rail rail--dest" id="vcRailRegion">
|
||||
<?php
|
||||
foreach ( $vc_cities as $vc_city ) :
|
||||
$vc_link = get_term_link( $vc_city );
|
||||
$vc_image = vc_term_image_url( $vc_city->term_id, 'viator_destination' );
|
||||
if ( is_wp_error( $vc_link ) ) {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
<li class="dcard">
|
||||
<?php if ( $vc_image ) : ?>
|
||||
<img class="dcard__img" src="<?php echo esc_url( $vc_image ); ?>" alt="<?php echo esc_attr( $vc_city->name ); ?>" loading="lazy">
|
||||
<?php endif; ?>
|
||||
<div class="dcard__body">
|
||||
<h3 class="dcard__title"><a href="<?php echo esc_url( $vc_link ); ?>"><?php echo esc_html( $vc_city->name ); ?></a></h3>
|
||||
<div class="dcard__meta">
|
||||
<div class="meta">
|
||||
<span class="meta__k"><?php echo esc_html__( 'Tours', 'viator-collector' ); ?></span>
|
||||
<span class="meta__v"><?php echo esc_html( number_format_i18n( (int) $vc_city->count ) ); ?></span>
|
||||
</div>
|
||||
<?php echo vc_ring_badge( 'VIEW TOURS · VIEW TOURS · ', $vc_link, 'card' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user