• Resolved ZoiX

    (@zoix)


    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 5 years, 6 months ago by ZoiX.
    • This topic was modified 5 years, 6 months ago by ZoiX.
    • This topic was modified 5 years, 6 months ago by ZoiX.
    • This topic was modified 5 years, 6 months ago by ZoiX.
    • This topic was modified 5 years, 6 months ago by ZoiX.
    • This topic was modified 5 years, 6 months ago by ZoiX.
    • This topic was modified 5 years, 6 months ago by ZoiX.
    • This topic was modified 5 years, 6 months ago by ZoiX.
    • This topic was modified 5 years, 6 months ago by ZoiX.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    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

    (@zoix)

    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. 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 Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    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.