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:
@@ -7,11 +7,16 @@
|
||||
* submits via GET. VC_Display::filter_archive_query() reads the same state.
|
||||
*
|
||||
* Args: $vc_title, $vc_subtitle, $vc_query, $vc_form_action, $vc_after_hero
|
||||
* (HTML printed between the hero and the results, e.g. the region city grid).
|
||||
* (HTML printed between the hero and the results, e.g. the region city grid),
|
||||
* $vc_tagline (line under the title), $vc_list_heading (heading above the
|
||||
* results) and $vc_jump (true: filtering and paging land on the results).
|
||||
*/
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$vc_after_hero = isset( $vc_after_hero ) ? (string) $vc_after_hero : '';
|
||||
$vc_after_hero = isset( $vc_after_hero ) ? (string) $vc_after_hero : '';
|
||||
$vc_tagline = isset( $vc_tagline ) ? (string) $vc_tagline : '';
|
||||
$vc_list_heading = isset( $vc_list_heading ) ? (string) $vc_list_heading : '';
|
||||
$vc_anchor = empty( $vc_jump ) ? '' : '#tour-list';
|
||||
|
||||
$f = VC_Display::get_filter_state();
|
||||
|
||||
@@ -53,9 +58,7 @@ $vc_dur_labels = array(
|
||||
);
|
||||
|
||||
// Whether any filter is active (drives the "Clear filters" control).
|
||||
$vc_active = ( '' !== $f['q'] || ! empty( $f['dest'] ) || ! empty( $f['cat'] ) || ! empty( $f['dur'] )
|
||||
|| $f['pmin'] > 0 || $f['pmax'] < 1000 || $f['rating'] > 0
|
||||
|| $f['freecancel'] || $f['bestdeal'] || $f['sellout'] );
|
||||
$vc_active = VC_Display::filters_active( $f );
|
||||
|
||||
// Current filters as a base URL, so pagination links keep the query string.
|
||||
$vc_base_args = array();
|
||||
@@ -70,12 +73,12 @@ if ( $f['bestdeal'] ) { $vc_base_args['bestdeal'] = 1; }
|
||||
if ( $f['sellout'] ) { $vc_base_args['sellout'] = 1; }
|
||||
if ( 'newest' !== $f['sort'] ) { $vc_base_args['sort'] = $f['sort']; }
|
||||
|
||||
$vc_page_url = function ( $n ) use ( $vc_action, $vc_base_args ) {
|
||||
$vc_page_url = function ( $n ) use ( $vc_action, $vc_base_args, $vc_anchor ) {
|
||||
$args = $vc_base_args;
|
||||
if ( $n > 1 ) {
|
||||
$args['paged'] = $n;
|
||||
}
|
||||
return empty( $args ) ? $vc_action : add_query_arg( $args, $vc_action );
|
||||
return ( empty( $args ) ? $vc_action : add_query_arg( $args, $vc_action ) ) . $vc_anchor;
|
||||
};
|
||||
|
||||
$vc_hero_img = vc_hero_image_source();
|
||||
@@ -94,8 +97,11 @@ $vc_hero_img = vc_hero_image_source();
|
||||
echo vc_breadcrumb_html( vc_breadcrumb_trail(), $vc_crumb_current ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
?>
|
||||
<h1 class="hero__title"><?php echo esc_html( $vc_title ); ?></h1>
|
||||
<?php if ( '' !== $vc_tagline ) : ?>
|
||||
<p class="hero__tagline"><?php echo esc_html( $vc_tagline ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<form class="filters" id="vc-filter-form" method="get" action="<?php echo esc_url( $vc_action ); ?>" novalidate>
|
||||
<form class="filters" id="vc-filter-form" method="get" action="<?php echo esc_url( $vc_action . $vc_anchor ); ?>" novalidate>
|
||||
<div class="filters__row">
|
||||
<div class="fsearch">
|
||||
<?php echo vc_icon( 'search', 'fsearch__icon' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
@@ -191,6 +197,10 @@ $vc_hero_img = vc_hero_image_source();
|
||||
|
||||
<section class="section" id="tour-list">
|
||||
<div class="container">
|
||||
<?php if ( '' !== $vc_list_heading ) : ?>
|
||||
<p class="pill cty-eyebrow"><?php echo esc_html__( 'Tours', 'viator-collector' ); ?></p>
|
||||
<h2 class="cty-h2 cty-tours-h"><?php echo esc_html( $vc_list_heading ); ?></h2>
|
||||
<?php endif; ?>
|
||||
<div class="results">
|
||||
<p class="results__count" role="status">
|
||||
<?php if ( $vc_total ) : ?>
|
||||
|
||||
Reference in New Issue
Block a user