I had a look into this problem you are having with the bridge theme.
There are a few issues that need to be resolved to get this working, and they are not easy to incorporate into your site:
1) The foogallery css and js are not being pulled into pages loaded by ajax. The only way to get around this is to enqueue these files on all pages. To do this, you can include this snippet in your functions.php file :
function foogallery_always_enqueue() {
if ( function_exists( 'foogallery_enqueue_core_gallery_template_style' ) ) {
foogallery_enqueue_core_gallery_template_style();
foogallery_enqueue_core_gallery_template_script();
}
}
add_action( ‘wp_enqueue_scripts’, ‘foogallery_always_enqueue’ );
And then you need to hook into the event that is triggered after the ajax is done. To hook into this, you will need to add some custom JS to your theme:
jQuery(function() {
jQuery(document).on("qodeAjaxPageLoad", function() {
jQuery('.foogallery').foogallery();
});
});
Thread Starter
srcrus
(@srcrus)
OMG!! Thank you so much!! It does work perfectly now!!
sorry I have the same problem, I added the code into funtions.php but I dont know where add the second code:
jQuery(function() {
jQuery(document).on(“qodeAjaxPageLoad”, function() {
jQuery(‘.foogallery’).foogallery();
});
});
Thread Starter
srcrus
(@srcrus)
Hello,
I’m afraid I’m having the same issue again. Thumbnails do not load until updating, but not at first time. For example in here:
https://colegiosanrafael.com/falla-escolar-2018/
@srcrus, let me explain how the css is cached in the plugin which might shed some light on your issue.
When the plugin updates, the version number is bumped which triggers a clearing of the plugins internal cache for all included css on all pages. This means that the next time a page is loaded with a foogallery shortcode, it then registers that page cache so the next time it loads, it knows up front that it needs to load the css in the head.
So the first time a gallery page is loaded after the update, it will load the css in the footer, but all times after that it will load in the head (which is correct).
The reason I do this, is because the shortcodes are in the page content after the page head, so this is a technique used to get around page-content-forward-scanning.
I hope this makes sense? I had a look at your page and it is loading correctly first time and after all refreshes.