I want to create a WordPress shortcode that will add an automated gallery of the contents in a folder. I am currently trying to implement this in a site that publishes 12 annual magazine issues, so as soon as a new PDF or JPG is dropped into a folder, it should be displayed on that specific gallery.
Meaning:
Archive
2013
Jan – Dec months need to be displayed, in a 4×3 or 6×2 grid gallery. If we are in June, and the latest issue is June, then only 6 JPGs would be displayed.
This way the client doesn’t need to make any modifications in the WordPress site. Instead the client can just drop the files to a specific folder via FTP, and the WordPress PHP function would auto populate the gallery according to what it’s able to fetch from that folder’s contents.
EDIT
Unfortunately, the “Folder Gallery” plugin is close but not good enough. It does not read the contents of folders that sit outside the WP uploads folder, and we don’t want to migrate the existing folder structure inside the WordPress install folder.
I also need it to open the links in a new window to the PDF of the magazine, and not a larger version of the picture in Fancybox.
It sounds like you just need shortcode to gather the contents of a folder and display a grid of those items. The shortcode is pretty easy to setup.
Then you just need to glob a directory and render your gallery from the files. I didn’t include a gallery but this will work outside of uploads. Just give it a path relative to the root folder.