-
AuthorPosts
-
June 8, 2016 at 7:51 am #1031743
Hello,
I need to create galleries from image folders uploaded to my site in bulk. I’d like add a new instance of The Grid plugin and specify the directory it should pull images from. Is this possible with the plugin? Is there a way to accomplish this task? It will be a pain to set up each image individually as there will be potentially hundreds of images to set up.
Thanks!
June 8, 2016 at 12:40 pm #1032344Hey Victor,
Sorry but that is not a supported source in the Grid. It would be technically possible however, implementation of it is outside the scope of our support.
Thanks.
June 8, 2016 at 1:05 pm #1032385Hello,
I can write PHP and JavaScript if I have to, just the need pseudo instructions.
Should I edit the functions php for a template, create a new php file in my web directory, copy a template file into my child template?
I know how to read in files from a server directory with PHP but how would I tie it to the plugin. Or should I skip the plugin and use jQuery masonry plugin or similar?
Any direction will be helpful please.
Thanks!
June 8, 2016 at 6:55 pm #1032829Hi there,
The Grid is the different author and we can’t provide customization related to it. It’s provided as is and can’t be overloaded through templates or functions.php. It’s much easier to re-create a masonry layout using javascript than modifying the existing The Grid functionality.
And about the javascript, it’s doable but we can’t really provide instruction. I can only is provide recommendation.
1. Create a shortcode version of your gallery
eg.
add_shortcode('my_gallery', 'my_gallery'); function my_gallery ( $atts ) { }
2. Add your loop that picks your image
eg.
add_shortcode('my_gallery', 'my_gallery'); function my_gallery ( $atts ) { foreach( $images as $image) { echo $image; } }
3. Then add your masonry script.
add_shortcode('my_gallery', 'my_gallery'); function my_gallery ( $atts ) { foreach( $images as $image) { echo $image; } echo '<script>start masonry here</script>'; }
4. Then add [my_gallery] to your content.
There are still more to do, but you can use this as a guide.
Thanks!
June 8, 2016 at 8:14 pm #1033009Awesome. Greatly appreciated!
June 8, 2016 at 11:02 pm #1033302You are most welcome. 🙂
-
AuthorPosts