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

  • Resolved jcsusano

    (@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
    JC

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

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

    (@iberezansky)

    Can say nothing about third party software. Debugging required.

    • This reply was modified 4 months, 1 week ago by iberezansky.
    jcsusano

    (@jcsusano)

    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.
    JC

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.