fix: Astra style conflicts, full-width, responsive hero images, header search

Plugin (viator-collector 1.8.1):
- is_vc_page() now matches any Viator shortcode, so shortcode Pages (home)
  get the full-width no-sidebar canvas
- load vc-design.css after Astra + inline overrides: strip Astra page-builder
  article padding (removes extra gap above hero), full-bleed containers,
  enforce design font inside .vc-app
- vc_hero_img_html(): render hero from the WP media library with responsive
  srcset when the image is an attachment; used in listing + [viator_hero]
  ([viator_hero image_id=".."])

Theme (astra child):
- remove the user/profile header item
- working header search (expands, submits to the tours archive ?vc_q=)
- load chrome.css after Astra + enforce design font inside .hoho
- rebuild installable ZIP

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4hNL1PSHxXbu94SCenpKj
This commit is contained in:
2026-09-15 17:32:07 +03:30
parent eab161aa5c
commit 67c88c795b
10 changed files with 158 additions and 29 deletions

View File

@@ -41,16 +41,25 @@ class VC_Sections {
public static function hero( $atts ) {
$atts = shortcode_atts(
array(
'title' => __( 'Set out on the journey.', 'viator-collector' ),
'eyebrow' => __( 'Tour & Travel', 'viator-collector' ),
'image' => '',
'title' => __( 'Set out on the journey.', 'viator-collector' ),
'eyebrow' => __( 'Tour & Travel', 'viator-collector' ),
'image' => '',
'image_id' => '', // WordPress media attachment ID (responsive).
),
$atts,
self::HERO
);
$img = $atts['image'] ? $atts['image'] : vc_hero_image_url();
if ( ! $img ) {
// Prefer a media-library image (responsive srcset); fall back to a URL,
// the plugin's Hero image setting, then the bundled image.
$img = '';
if ( '' !== $atts['image_id'] ) {
$img = absint( $atts['image_id'] );
} elseif ( '' !== $atts['image'] ) {
$img = $atts['image'];
} elseif ( vc_hero_image_url() ) {
$img = vc_hero_image_url();
} else {
$img = vc_asset_url( 'img/hero.png' );
}
$archive = get_post_type_archive_link( 'viator_tour' );
@@ -64,7 +73,7 @@ class VC_Sections {
<div class="vc-app vc-sections">
<section class="hero">
<div class="hero__media">
<img class="hero__img" src="<?php echo esc_url( $img ); ?>" alt="" fetchpriority="high">
<?php echo vc_hero_img_html( $img, 'hero__img', true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<div class="hero__scrim" aria-hidden="true"></div>
</div>
<div class="container hero__content">