Title: Using the do_shortcode function in a repeater template
Last modified: January 23, 2020

---

# Using the do_shortcode function in a repeater template

 *  [j8bm](https://wordpress.org/support/users/jarelle/)
 * (@jarelle)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/using-the-do_shortcode-function-in-a-repeater-template/)
 * Hi,
    Just trying to include some shortcode in my repeater template but it won’t
   function correctly.
 *     ```
       <?php 
       $video_id = get_field('youtube_video_id');
       echo do_shortcode('[video_lightbox_youtube video_id="'.$video_id.'" width="640" height="480" anchor="Play Me!"]');
       ?> 
       ```
   
 * Is this possible to do?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/using-the-do_shortcode-function-in-a-repeater-template/#post-12358268)
 * Hi [@jarelle](https://wordpress.org/support/users/jarelle/),
    What is happening
   when you render the shortcode in the template?
 * Thanks,
 *  Thread Starter [j8bm](https://wordpress.org/support/users/jarelle/)
 * (@jarelle)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/using-the-do_shortcode-function-in-a-repeater-template/#post-12374870)
 * Hi [@dcooney](https://wordpress.org/support/users/dcooney/), thanks for your 
   reply. It’s creating the correct code:
 * `<a id="5e30bf109cce9" rel="wp-video-lightbox" href="https://www.youtube.com/
   watch?v=viAKw09TJSk&width=640&height=480" title="">Play Me!</a>`
 * But it just links to the Youtube page/URL and it’s meant to open a lightbox on
   the same page with the embedded video.
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/using-the-do_shortcode-function-in-a-repeater-template/#post-12378352)
 * Ok, so what lightbox plugin is being used.
    As always, when content is loaded
   with Ajax you need to initiate elements that require JS. This because they are
   usually initiated on page load.
 * Let me know.
 *  Thread Starter [j8bm](https://wordpress.org/support/users/jarelle/)
 * (@jarelle)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/using-the-do_shortcode-function-in-a-repeater-template/#post-12379179)
 * The plugin being used is [WP Video Lightbox](https://wordpress.org/plugins/wp-video-lightbox)
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/using-the-do_shortcode-function-in-a-repeater-template/#post-12379189)
 * Ok thanks [@jarelle](https://wordpress.org/support/users/jarelle/)
    Might best
   be best if you could open a support ticket with them directly.
 * There is a callback we can use if they have a function we need to dispatch.
    
   [https://connekthq.com/plugins/ajax-load-more/docs/callback-functions/almcomplete/](https://connekthq.com/plugins/ajax-load-more/docs/callback-functions/almcomplete/)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Using the do_shortcode function in a repeater template’ is closed to 
new replies.

 * ![](https://ps.w.org/ajax-load-more/assets/icon-256x256.png?rev=2944639)
 * [Ajax Load More – Infinite Scroll, Load More, & Lazy Load](https://wordpress.org/plugins/ajax-load-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-load-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-load-more/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-load-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-load-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-load-more/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/using-the-do_shortcode-function-in-a-repeater-template/#post-12379189)
 * Status: not resolved