• When using a gallery defined on an error template , gallery css and js isn’t loaded.
    the js and css enqueuing is done here:

    	$baguettebox_enqueue_assets = apply_filters( 'baguettebox_enqueue_assets',
    		has_block( 'core/gallery' ) ||
    		has_block( 'core/image' ) ||
    		has_block( 'core/media-text' ) ||
    		get_post_gallery() ||
    		has_block( 'coblocks/gallery-masonry' ) ||
    		has_block( 'coblocks/gallery-stacked' ) ||
    		has_block( 'coblocks/gallery-collage' ) ||
    		has_block( 'coblocks/gallery-offset' ) ||
    		has_block( 'coblocks/gallery-stacked' )
    	);
    
    	if ( $baguettebox_enqueue_assets ) {
    		wp_enqueue_script( 'baguettebox' );
    		wp_enqueue_style( 'baguettebox-css' );
    	}
    

    I think that my gallery being defined in the theme template, not in some content it is not detected by function enqueue_assets().
    Does anyone has an idea to make gallery work in this special case?

    Possible Workaround: I know that I could force enqueing assets in my theme for error page.
    Regards, Christophe

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘gallery defined in a template issue’ is closed to new replies.