Support » Plugin: Interactive 3D FlipBook » Using shortcode with ACF into page template triggers js error

  • Resolved jcsusano


    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

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author iberezansky


    Can say nothing about third party software. Debugging required.

    • This reply was modified 10 months ago by iberezansky.

    Hello @iberezansky,
    Problem solved. I was not using the correct call to the ACF field and also that there was a function in my theme that did not allow to call the post thumbnail correctly generating the js error.
    Once again awesome plugin.
    Thank you.

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.