feat: city guide on city pages (tagline, facts, About, seasons)

Editable per city under Viator tours > Destinations. Shown above the
tours on page 1 of an unfiltered listing only; filtering and paging jump
to the results. Text recovered from the six old /tour-destination/ pages
is imported once into empty guides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 09:58:54 +03:30
parent 466ea0ac5f
commit 2ded000a27
12 changed files with 846 additions and 10 deletions

View File

@@ -9,6 +9,17 @@ get_header();
$vc_term = get_queried_object();
$vc_name = ( $vc_term && ! is_wp_error( $vc_term ) ) ? $vc_term->name : __( 'Tours', 'viator-collector' );
$vc_desc = term_description();
// City guide (destinations only): tagline in the banner; facts, About and
// Seasons above the tours on page 1 of an unfiltered listing.
$vc_guide = '';
$vc_tagline = '';
if ( is_tax( 'viator_destination' ) && $vc_term && ! is_wp_error( $vc_term ) ) {
$vc_tagline = VC_City_Guide::tagline( $vc_term );
if ( VC_City_Guide::is_visible_here() ) {
$vc_guide = VC_City_Guide::render( $vc_term );
}
}
?>
<main class="vc-app vc-listing vc-listing--term">
<?php
@@ -24,6 +35,11 @@ $vc_desc = term_description();
'url' => get_post_type_archive_link( 'viator_tour' ),
),
),
'vc_tagline' => $vc_tagline,
'vc_after_hero' => $vc_guide,
/* translators: %s: city name. */
'vc_list_heading' => $vc_guide ? sprintf( __( 'Things to do in %s', 'viator-collector' ), $vc_name ) : '',
'vc_jump' => '' !== $vc_guide,
)
);
?>