Using shortcode with ACF into page template triggers js error
-
Hello Iberezansky,
First, Awesome plugin!
I’m trying to run your shortcode with an ACF field called “archivo” and the function to call the post thumbnail into a page template:Here it is:
<?php if( get_field('archivo') ): ?> <?php echo do_shortcode('[3d-flip-book mode="thumbnail-lightbox" urlparam="reporte-sustentabilidad" pdf="'. the_field('archivo').'" template="short-white-book-view" lightbox="dark" thumbnail="'. the_post_thumbnail('medium').'"]'); ?> <?php endif; ?>
But it is displaying a js error in the console:
Uncaught (in promise) TypeError: Cannot read property 'thumbnail' of undefined at thumbnail-lightbox.min.js?ver=1.6:3 at new Promise (<anonymous>) at fetchThumbnailInfo (thumbnail-lightbox.min.js?ver=1.6:3) at thumbnail-lightbox.min.js?ver=1.6:1
If you check the link you will see that the value in the acf field and the post thumbnail work correctly but the shortcode is NOT taking it as params but if I run the same shortcode in a simple page or post via editor it works ok.
Please let know what could be happening.
Thank you
JCThe page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Using shortcode with ACF into page template triggers js error’ is closed to new replies.