Hi 🙂
The Envira scripts will only load on a page if the shortcode is present. So if the Blog index page shows an Envira gallery before the ‘more’ tag – you shouldn’t have to enqueue anything.
I suppose it would depend on how you are calling the content of the posts into the blog index page?
Below is the structure of the infinite scrolling blog.
blog.php is populated by blog-loop.php with the 3 most recent posts.
As the user scrolls down half the page, an ajax call is made to blog-loop.php to get the next three posts.
The blog.php template shows the entire post, so the user does not click to a single.php.
Would there be a way to show an empty gallery so it enqueues the correct scripts onto the page?
Thank you very much for your assistance.
I tested an empty gallery in the template page and the scripts do not enqueue for me.
When using a gallery with images I get the scripts enqueueing.
Ideally I’d like to be able to use use the ‘wp_enqueue_scripts’ hook to enqueue the scripts needed to the blog.php page.
When the scripts are being loaded on the blog.php page, each post, brought in via ajax, containing a gallery loads with opacity of 0 and the masonry layout is broken.
Is there a function I need to trigger after loading a post with a gallery via ajax?
Thanks again.
-
This reply was modified 9 years, 3 months ago by
Gtru1021.
-
This reply was modified 9 years, 3 months ago by
Gtru1021.
Hi 🙂
Unfortunately this is not currently possible. I had to reach out to the developer to confirm this (due to Ajax)
I’ve opened up a ticket with the developers to correct this, but I don’t have an ETA on when that will be updated, but he will be looking into it.
Can I help with anything else?