Title: Dynamic loading from file
Last modified: September 5, 2025

---

# Dynamic loading from file

 *  Resolved [tedmac21](https://wordpress.org/support/users/tedmac21/)
 * (@tedmac21)
 * [9 months ago](https://wordpress.org/support/topic/dynamic-loading-from-file/)
 * I have set up a gallery to dynamically pull from a directory on my server. This
   works when I first set up the gallery, and the images load, however as I add 
   more images to the directory they are not dynamically loading to the gallery.
   The images are added via front-end upload using WPForms. Any reasons this could
   be happening?
 * Also, videos present in the folder are not loading at all.

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

 *  Plugin Support [elviiso](https://wordpress.org/support/users/elviiso/)
 * (@elviiso)
 * [9 months ago](https://wordpress.org/support/topic/dynamic-loading-from-file/#post-18630325)
 * Hi [@tedmac21](https://wordpress.org/support/users/tedmac21/)
 * Thanks for reaching out about this!
 * Just to clarify, the Server Folder feature in FooGallery is designed to work 
   only with images, not videos or other media types. That’s why the videos in the
   folder weren’t being added.
 * If you’d like to create a gallery that includes both, you can first add your 
   images through the media library, then import the videos separately. Here’s a
   quick guide for adding videos: [https://fooplugins.com/documentation/foogallery/pro-expert/foogallery-pro-video/](https://fooplugins.com/documentation/foogallery/pro-expert/foogallery-pro-video/)
 * As for the issue you’re seeing with images not loading dynamically when using
   the Server Folder datasource, this is likely due to our built-in 24-hour caching.
   This caching helps reduce server load by avoiding repeated folder reads every
   time the gallery loads, especially as the gallery has more and more images added
   to it as in your case.
 * To reflect new images immediately, you can simply edit and update the gallery
   in your WordPress admin, which will force a cache refresh.
 * If you’d prefer to shorten the cache window, you can add this snippet to your
   functions.php file to change it (e.g. to 3 hours):
 *     ```wp-block-code
       add_filter( 'foogallery_datasource_folder_expiry', 'foogallery_datasource_folder_expiry_override' );function foogallery_datasource_folder_expiry_override( $default ) {    return 3; // sets cache duration to 3 hours}
       ```
   
 * If you have any questions, don’t hesitate to ask.
 * Kind regards,
   Elvis.
 *  Thread Starter [tedmac21](https://wordpress.org/support/users/tedmac21/)
 * (@tedmac21)
 * [9 months ago](https://wordpress.org/support/topic/dynamic-loading-from-file/#post-18632428)
 * That helped, thanks!

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

The topic ‘Dynamic loading from file’ is closed to new replies.

 * ![](https://ps.w.org/foogallery/assets/icon-256x256.gif?rev=2602542)
 * [Photo Gallery by FooGallery : Responsive Image Gallery, Masonry Gallery & Carousel](https://wordpress.org/plugins/foogallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/foogallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/foogallery/)
 * [Active Topics](https://wordpress.org/support/plugin/foogallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/foogallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/foogallery/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [tedmac21](https://wordpress.org/support/users/tedmac21/)
 * Last activity: [9 months ago](https://wordpress.org/support/topic/dynamic-loading-from-file/#post-18632428)
 * Status: resolved