Replaces the home page's plain-navy hero with a full-bleed video-background
section + dark navy overlay (60%) for text readability. The video URL is
read from the WP option `av_home_hero_video_url`. If empty, the hero
gracefully falls back to a solid navy background — same layout, same text,
just no video.
Settings (Bricks-native background.videoUrl pattern from container.php
get_background_video_html) :
- videoUrl : the configured option value
- videoScale : 'cover'
- videoAspectRatio : '16/9'
- overlay : rgba(11,31,58,0.6) navy 60%
- color fallback while video loads
Typography :
- H1 : 3.5rem white, weight 800, tight letter-spacing, responsive
breakpoints down to 1.875rem on mobile
- Lead : muted-white rgba 0.85
- CTAs : gold primary + outline-on-dark secondary
Helper mu-plugin av-set-home-video.php :
/?av_set_home_video=https://...mp4 sets the URL
/?av_set_home_video=clear empties (back to navy)
Workflow :
1. Upload MP4 to Media Library, copy URL
2. /?av_set_home_video=<URL>
3. /?av_generate_home=1
4. Visit / — cinematic hero with looping muted autoplay video bg
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
38 lines
1.4 KiB
PHP
38 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: Asterion — Set Home hero video URL (one-shot)
|
|
* Description:
|
|
* /?av_set_home_video=URL → stores the URL in WP option `av_home_hero_video_url`
|
|
* /?av_set_home_video=clear → empties the option (hero falls back to navy bg)
|
|
*
|
|
* After running, re-run /?av_generate_home=1 to apply the change to the hero.
|
|
*
|
|
* URL formats supported by Bricks's background video :
|
|
* - Self-hosted : https://yoursite.com/wp-content/uploads/.../video.mp4 (any MP4/WebM)
|
|
* - YouTube : full URL or ID
|
|
* - Vimeo : full URL or ID
|
|
*/
|
|
defined('ABSPATH') || exit;
|
|
|
|
add_action('template_redirect', function () {
|
|
if (! in_array($_SERVER['SERVER_NAME'] ?? '', ['localhost', '127.0.0.1'], true)) return;
|
|
if (! isset($_GET['av_set_home_video'])) return;
|
|
|
|
header('Content-Type: text/plain; charset=utf-8');
|
|
|
|
$url = trim((string) $_GET['av_set_home_video']);
|
|
$before = (string) get_option('av_home_hero_video_url', '');
|
|
|
|
if ($url === 'clear' || $url === '') {
|
|
delete_option('av_home_hero_video_url');
|
|
echo "Home hero video URL CLEARED (was: '$before')\n";
|
|
echo "Hero will fall back to solid navy background.\n";
|
|
} else {
|
|
update_option('av_home_hero_video_url', esc_url_raw($url));
|
|
echo "Home hero video URL set : '$before' → '" . esc_url_raw($url) . "'\n";
|
|
}
|
|
|
|
echo "\nNow re-run /?av_generate_home=1 to apply the change.\n";
|
|
exit;
|
|
});
|