diff --git a/astra-child-hoponhopoff.zip b/astra-child-hoponhopoff.zip index 79ac09b..64a1e9c 100644 Binary files a/astra-child-hoponhopoff.zip and b/astra-child-hoponhopoff.zip differ diff --git a/astra-child-hoponhopoff/assets/pages-wp.css b/astra-child-hoponhopoff/assets/pages-wp.css index 7eab344..0af635e 100644 --- a/astra-child-hoponhopoff/assets/pages-wp.css +++ b/astra-child-hoponhopoff/assets/pages-wp.css @@ -60,3 +60,6 @@ body.hoho-fullwidth{overflow-x:hidden;} /* Form fields stay flat as in the design (Astra adds a shadow/border). */ .hoho-page.hoho-page .rinput{box-shadow:none!important;border:0!important;} + +/* A page's own Featured Image banner is shown as-is: no brand-teal tint. */ +.hoho-page.hoho-page .hero--has-thumb .hero__media::after{display:none;} diff --git a/astra-child-hoponhopoff/functions.php b/astra-child-hoponhopoff/functions.php index 5650a13..cc07b68 100644 --- a/astra-child-hoponhopoff/functions.php +++ b/astra-child-hoponhopoff/functions.php @@ -23,10 +23,10 @@ add_action( 'wp_enqueue_scripts', function () { if ( wp_style_is( 'astra-theme-css', 'registered' ) ) { $deps[] = 'astra-theme-css'; } - wp_enqueue_style( 'hoho-chrome', get_stylesheet_directory_uri() . '/assets/chrome.css', $deps, '1.0.11' ); + wp_enqueue_style( 'hoho-chrome', get_stylesheet_directory_uri() . '/assets/chrome.css', $deps, '1.0.12' ); // Header interactions: burger, submenu, sticky, back-to-top, search toggle. - wp_enqueue_script( 'hoho-chrome', get_stylesheet_directory_uri() . '/assets/chrome.js', array(), '1.0.11', true ); + wp_enqueue_script( 'hoho-chrome', get_stylesheet_directory_uri() . '/assets/chrome.js', array(), '1.0.12', true ); wp_add_inline_style( 'hoho-chrome', diff --git a/astra-child-hoponhopoff/inc/pages.php b/astra-child-hoponhopoff/inc/pages.php index a3e318d..5d5da30 100644 --- a/astra-child-hoponhopoff/inc/pages.php +++ b/astra-child-hoponhopoff/inc/pages.php @@ -54,6 +54,16 @@ function hoho_asset( $path ) { return get_stylesheet_directory_uri() . '/assets/' . ltrim( $path, '/' ); } +/** + * Banner image for a design page: the page's Featured Image when one is set + * (for the blog list, the Posts page's), otherwise the design's own photo. + */ +function hoho_banner_url( $fallback ) { + $page_id = ( is_home() && get_option( 'page_for_posts' ) ) ? (int) get_option( 'page_for_posts' ) : get_queried_object_id(); + $url = $page_id ? get_the_post_thumbnail_url( $page_id, 'full' ) : ''; + return $url ? $url : hoho_asset( 'img/' . $fallback . '.webp' ); +} + /** * Social profile links (footer + contact page). Override with the * `hoho_socials` filter. diff --git a/astra-child-hoponhopoff/style.css b/astra-child-hoponhopoff/style.css index 4c3301e..339bf8b 100644 --- a/astra-child-hoponhopoff/style.css +++ b/astra-child-hoponhopoff/style.css @@ -4,7 +4,7 @@ Theme URI: https://git.kaamyab.dev/vargha/TourWebsite Description: Astra child theme that replaces the Astra header and footer with the "Hop On Hop Off" design. Pairs with the Viator Collector plugin. Author: Amir Bagheri Template: astra -Version: 1.0.11 +Version: 1.0.12 Text Domain: hoponhopoff */ diff --git a/astra-child-hoponhopoff/templates/about.php b/astra-child-hoponhopoff/templates/about.php index e6e8c28..871aa70 100644 --- a/astra-child-hoponhopoff/templates/about.php +++ b/astra-child-hoponhopoff/templates/about.php @@ -9,7 +9,7 @@ get_header();
- +
diff --git a/astra-child-hoponhopoff/templates/blog.php b/astra-child-hoponhopoff/templates/blog.php index 06bd1c2..715a7c6 100644 --- a/astra-child-hoponhopoff/templates/blog.php +++ b/astra-child-hoponhopoff/templates/blog.php @@ -40,7 +40,7 @@ for ( $n = 1; $n <= $hoho_max; $n++ ) {
- +
diff --git a/astra-child-hoponhopoff/templates/contact.php b/astra-child-hoponhopoff/templates/contact.php index 99c0c6e..f739b52 100644 --- a/astra-child-hoponhopoff/templates/contact.php +++ b/astra-child-hoponhopoff/templates/contact.php @@ -7,9 +7,9 @@ defined( 'ABSPATH' ) || exit; get_header(); ?>
-
+
- +
diff --git a/astra-child-hoponhopoff/templates/faq.php b/astra-child-hoponhopoff/templates/faq.php index 47633a4..69fb7b5 100644 --- a/astra-child-hoponhopoff/templates/faq.php +++ b/astra-child-hoponhopoff/templates/faq.php @@ -7,9 +7,9 @@ defined( 'ABSPATH' ) || exit; get_header(); ?>
-
+
- +
diff --git a/viator-collector.zip b/viator-collector.zip index d25d8aa..ec4d876 100644 Binary files a/viator-collector.zip and b/viator-collector.zip differ diff --git a/viator-collector/includes/helpers.php b/viator-collector/includes/helpers.php index 237a07b..a435091 100644 --- a/viator-collector/includes/helpers.php +++ b/viator-collector/includes/helpers.php @@ -141,13 +141,21 @@ function vc_hero_image_url() { /** * Hero image *source* for the current view: an attachment ID when available * (so it can be rendered responsively), otherwise a URL. Resolution order: - * 1. On a term archive, that term's own image. - * 2. The "Hero image" chosen in Settings (attachment ID preferred). - * 3. Nothing. + * 1. On a page (e.g. the homepage hosting [viator_hero]), its Featured Image. + * 2. On a term archive, that term's own image. + * 3. The "Hero image" chosen in Settings (attachment ID preferred). + * 4. Nothing. * * @return int|string Attachment ID, image URL, or '' . */ function vc_hero_image_source() { + if ( is_singular() && ! is_singular( 'viator_tour' ) ) { + $thumb = (int) get_post_thumbnail_id( get_queried_object_id() ); + if ( $thumb ) { + return apply_filters( 'vc_hero_image_source', $thumb ); + } + } + if ( is_tax( array( 'viator_destination', 'viator_tag', 'viator_category' ) ) ) { $term = get_queried_object(); if ( $term && ! is_wp_error( $term ) ) { diff --git a/viator-collector/viator-collector.php b/viator-collector/viator-collector.php index c32f095..7702d66 100644 --- a/viator-collector/viator-collector.php +++ b/viator-collector/viator-collector.php @@ -4,13 +4,13 @@ defined('ABSPATH') || exit; /** * Plugin Name: Viator Collector * Description: Import Viator tours using the Viator Partner API and display them with native WordPress post types, templates, and shortcodes. - * Version: 1.9.3 + * Version: 1.9.4 * Author: Amir Bagheri * License: GPL-2.0-or-later * Text Domain: viator-collector */ -define('VC_VERSION', '1.9.3'); +define('VC_VERSION', '1.9.4'); define('VC_PLUGIN_FILE', __FILE__); define('VC_PLUGIN_DIR', plugin_dir_path(__FILE__)); define('VC_PLUGIN_URL', plugin_dir_url(__FILE__));