There are many great code snippets in their Gitlab. You might find more on their…
Total Theme: Trigger Modal via URL or Button
//Trigger 1 Button #lightboxcontent https://total.wpexplorer.com/docs/adding-ilightbox-popups-inline/
//Trigger 2 URL /?success=confirmation https://total.wpexplorer.com/docs/snippets/trigger-lighbox-via-url/
//not needed if other lightbox elements present or do_shortcode below
add_filter( 'wpex_load_ilightbox_globally', '__return_true' );
add_action( 'wp_footer', function() {
//do_shortcode('[vcex_button onclick="popup" text_source="custom_text" onclick_lightbox_title="" onclick_lightbox_caption="" unique_id="confirmation" onclick_url="#lightboxcontent" onclick_lightbox_dims="450x330" visibility="hidden"]Lightbox[/vcex_button]';
?>
<a href="#lightboxcontent" id="confirmation" class="wpex-lightbox hidden" data-type="inline" data-width="450" data-height="330">Trigger</a>
<div class="wpb_text_column hidden" id="lightboxcontent">
<div class="wpb_wrapper">
<h3>Vielen Dank für Dein Interesse!</h3>
<p> Wir haben Dir eine Anfrage zur Bestätigung Deiner Anmeldung an die von Dir angegebene E-Mail-Adresse gesendet.</p>
</div>
</div>
<script>
var myHashLightbox = function() {
let queryString = window.location.search;
let urlParams = new URLSearchParams( queryString );
let modalID = urlParams.get( 'success' );
let modal = document.querySelector( '#' + modalID );
if ( modal && modal.classList.contains( 'wpex-lightbox' ) ) {
modal.click();
}
};
window.addEventListener( 'load', myHashLightbox );
</script>
<?php } );
Dieser Beitrag hat 0 Kommentare