Hi @mooer,
Thank you for reaching out to us and for the detailed report.
Spectra Image Gallery lightbox is failing to initialise on that page, and when it fails it leaves an invisible full screen layer sitting above your content.
The cause is a single image caption in that gallery. One of the captions ends with the words knuckles to the bed, wrapped in straight double quotes. Those quote characters break the page scripts Spectra saves for that page, and your browser console shows the resulting syntax error. Your working page has no double quotes in its captions, which is why it behaves normally.
This also explains what you noticed about saving. Right after a save the scripts are correct, then the broken saved copy takes over again, which is why it works for a few minutes before the problem returns.
To fix it right away:
- Go to Media, then Library, and open the image whose caption ends with knuckles to the bed.
- Remove the two straight double quote characters from the Caption field, or replace them with single quotes.
- While you are there, check the Caption and Alt Text of the other images in that gallery for the same characters.
- Open the page in the editor and click Update once, so the page scripts are generated again.
- Clear all caches on your site and any caching service you use, then reload the page.
Clicks should work normally after that.
We have already logged this as a bug on our side and the fix has been approved by our development team, so it will be handled properly in an upcoming Spectra release and will not need any manual work from then on.
If you would rather not edit the captions, here is a temporary snippet that works around it by telling Spectra to build the page scripts fresh on every load instead of reusing the saved copy. Add it through a snippets plugin such as Code Snippets or WPCode, which makes it easy to remove later, or in your child theme functions.php file.
/**
* Temporary workaround for a Spectra Image Gallery issue where a double quote
* in an image caption or alt text breaks the saved page scripts.
* Please remove this once the Spectra release with the fix is installed.
*/
add_filter( 'get_post_metadata', 'spectra_bypass_assets_cache', 10, 4 );
function spectra_bypass_assets_cache( $value, $object_id, $meta_key, $single ) {
if ( '_uag_page_assets' === $meta_key ) {
return array( array() );
}
return $value;
}
add_filter( 'update_post_metadata', 'spectra_skip_assets_cache_write', 10, 3 );
function spectra_skip_assets_cache_write( $check, $object_id, $meta_key ) {
if ( '_uag_page_assets' === $meta_key ) {
return true;
}
return $check;
}
Here is our guide on adding custom code, in case it helps: https://wpastra.com/docs/add-custom-php-code/
Please give the caption change a try first and let us know how it goes.
If the clicks still do not work after clearing your caches, share a screenshot of your browser console on that page and we will take another look.
Have a great day ahead!