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>
49 lines
1.6 KiB
PHP
49 lines
1.6 KiB
PHP
<?php
|
|
/**
|
|
* Shared archive for Viator destination / tag / category terms.
|
|
* Reuses the same listing UI (filters, sort, pagination) as the main archive.
|
|
*/
|
|
defined( 'ABSPATH' ) || exit;
|
|
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
|
|
echo vc_get_template( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
'listing.php',
|
|
array(
|
|
'vc_title' => $vc_name,
|
|
/* translators: %s: term name. */
|
|
'vc_subtitle' => $vc_desc ? wp_strip_all_tags( $vc_desc ) : sprintf( __( 'Explore the best tours in %s.', 'viator-collector' ), $vc_name ),
|
|
'vc_crumb' => array(
|
|
array(
|
|
'label' => __( 'Tours', 'viator-collector' ),
|
|
'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,
|
|
)
|
|
);
|
|
?>
|
|
</main>
|
|
<?php
|
|
get_footer();
|