Title: Shortcode &#8211; WordPress REST API
Last modified: May 6, 2019

---

# Shortcode – WordPress REST API

 *  Resolved [ZoiX](https://wordpress.org/support/users/zoix/)
 * (@zoix)
 * [7 years ago](https://wordpress.org/support/topic/shortcode-wordpress-rest-api/)
 * Hello!
 * I am using WordPress with Vue and so far everything is working smoothly. However,
   when I tried to implement Instagram Feed Plugin, I am having some troubles.
 * I am able to retrieve the shortcode equivalent in HTML from the WP REST API, 
   but it seems that the JS code is not being executed.
 * So far what I have realized is the following:
    - I need to have a `do_shortcode` in PHP so the plugin will load the JS files
      in `wp_footer()`; of course, it will also load the feed, and that is not the
      desired behavior since I want to show it from Vue.
    - If I mark _Enqueue JS file in head_, it actually loads everything in `wp_head()`,
      not the desired behavior since I would like to load all the JS files in `wp_footer()`,
      but if this is the only way to load the JS files without calling `do_shortcode`
      in PHP, it is ok.
    - Even loading the JS files “correctly” (in `wp_head()`), it seems that the 
      plugin is not calling the AJAX function to load the feed. It is showing me
      the preloading icon without retrieving the images.
    - Forcing the `div` that contains the shortcode to reload, gives me the following
      error: `jQuery(...).sbiOwlCarousel is not a function`.
    - Forcing the `div` that contains the shortcode to reload and calling `do_shortcode`
      from PHP (and if I call it, it loads the JS files automatically), do not give
      me any error.
    - The tow previous points make me think that the _Enqueue JS file in head_ (
      and without calling the `do_shortcode` in PHP) is not actually loading everything.
 * So, is there any way to make this happen? Should I call something from Vue? Or
   maybe add something in the custom JS code option to force the plugin to retrieve
   the feed?
 * I will upload the site tomorrow to a public link so I can share it with you guys.
   In the meantime, here you have a screenshot of the code I am getting from the
   WP REST API:
 * [[
 * Thank you in advance!
    -  This topic was modified 7 years ago by [ZoiX](https://wordpress.org/support/users/zoix/).
    -  This topic was modified 7 years ago by [ZoiX](https://wordpress.org/support/users/zoix/).
    -  This topic was modified 7 years ago by [ZoiX](https://wordpress.org/support/users/zoix/).
    -  This topic was modified 7 years ago by [ZoiX](https://wordpress.org/support/users/zoix/).
    -  This topic was modified 7 years ago by [ZoiX](https://wordpress.org/support/users/zoix/).
    -  This topic was modified 7 years ago by [ZoiX](https://wordpress.org/support/users/zoix/).
    -  This topic was modified 7 years ago by [ZoiX](https://wordpress.org/support/users/zoix/).
    -  This topic was modified 7 years ago by [ZoiX](https://wordpress.org/support/users/zoix/).
    -  This topic was modified 7 years ago by [ZoiX](https://wordpress.org/support/users/zoix/).

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

 *  Plugin Contributor [Craig at Smash Balloon](https://wordpress.org/support/users/craig-at-smash-balloon/)
 * (@craig-at-smash-balloon)
 * [7 years ago](https://wordpress.org/support/topic/shortcode-wordpress-rest-api/#post-11501044)
 * Hey ZoiX,
 * This is due to the fact that the feed is loaded with AJAX after the page loads.
   This will change in the next major update (5.0) due out in a few months.
 * In the meantime, I’m not sure if your plans will work well with the plugin I’m
   afraid.
 * Let me know if you have more questions!
 * – Craig
 *  Thread Starter [ZoiX](https://wordpress.org/support/users/zoix/)
 * (@zoix)
 * [7 years ago](https://wordpress.org/support/topic/shortcode-wordpress-rest-api/#post-11502784)
 * Hello Craig,
 * Thank you for your quick response. It totally makes sense!
 * In the meantime, I was able to generate a JSON from the instagram API passing
   them an [access token](https://www.instagram.com/developer/endpoints/users/).
   It gives me all the data I need; a little bit of CSS and JS will make the trick,
   hopefully.
 * I will have my eyes open for the next major update.
 * Thank you again Craig!
 *  Plugin Contributor [Craig at Smash Balloon](https://wordpress.org/support/users/craig-at-smash-balloon/)
 * (@craig-at-smash-balloon)
 * [7 years ago](https://wordpress.org/support/topic/shortcode-wordpress-rest-api/#post-11505140)
 * Sounds good! I’m glad you are able to get something working in the meantime.
 * Have a great rest of your week!

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

The topic ‘Shortcode – WordPress REST API’ is closed to new replies.

 * ![](https://ps.w.org/instagram-feed/assets/icon-256x256.png?rev=2700807)
 * [Smash Balloon Social Photo Feed – Easy Social Feeds Plugin](https://wordpress.org/plugins/instagram-feed/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/instagram-feed/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/instagram-feed/)
 * [Active Topics](https://wordpress.org/support/plugin/instagram-feed/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/instagram-feed/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/instagram-feed/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Craig at Smash Balloon](https://wordpress.org/support/users/craig-at-smash-balloon/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/shortcode-wordpress-rest-api/#post-11505140)
 * Status: resolved