Can’t exit web stories when imported via shortcode
-
Hello,
Thanks for this great tool!
I want to use a shortcode to import where I want (below the cart button on my product page) the stories.
Only, when I do it, there is a bug. When I click on the cross to close the stories, it does not work.
[web_stories excerpt="false" image_alignment="left" author="false" date="false" archive_link="false" view="circles" circle_size="100" sharp_corners="false"]
I specify that when I use the stories block directly from Guttenberg, it works.
Worse, when I import the shortcode into the Guttenberg “shortcode” block, it works too.
But when I use PHP to import the shortcode on my product page, it doesn’t work.
I can see the URL changed (it goes from the archive URL to the URL of my product page) but the classes that are supposed to be removed to close the lightbox are not removed.
Example of my PHP CODE :
<?php
function add_webstories_list_after_add_to_cart() {
?>
<div class="text-white text-[1px]">test</div>
<?php echo do_shortcode('[web_stories excerpt="false" image_alignment="left" author="false" date="false" archive_link="false" view="circles" circle_size="100" sharp_corners="false"]'); ?>
<?php
}
// Ajouter la fonction au hook 'woocommerce_after_add_to_cart_button'
add_action('woocommerce_after_add_to_cart_button', 'add_webstories_list_after_add_to_cart');Can you help ?
Thanks from Belgium!
- The topic ‘Can’t exit web stories when imported via shortcode’ is closed to new replies.