Hey Jasper,
As the plugin uses a shortcode to load the feed then it’s difficult to do this, as when loading the header of your site it doesn’t know yet whether the [instagram-feed] shortcode is going to be in the content of that page. The good news is that as web browsers cache CSS and JavaScript files then there isn’t any additional requests or loading time when the visitor goes from page to page.
If you really wanted to only load the plugin files on certain pages then you could dequeue the plugin CSS and JavaScript files in your theme’s functions.php file and then add a conditional in your header and footer file which only includes them on certain pages. Let me know whether that makes sense.
John
Hi John,
Thanks for the speedy response.
I totally get what you’re saying and you have a good point.
Since the feed is shown on the homepage the script is already cached by most of the visitors and it would seem to much of a hassle to dequeue it and conditionally add it again.
Cheers!
Jasper
No problem, just let me know if you have any other questions at all and I’d be happy to help!
Also, no obligation of course, but if you like the plugin and feel like leaving a super-quick review then we always really appreciate it 🙂
John