Skip to content

Instantly share code, notes, and snippets.

@benhowdle89
Last active December 11, 2015 06:28
Show Gist options
  • Save benhowdle89/4559572 to your computer and use it in GitHub Desktop.
Save benhowdle89/4559572 to your computer and use it in GitHub Desktop.
WP Plugin/approach for custom gallery
If a plugin already exists then great, but I can't find one!
A client wants to simply select some images from the media
library and assign them to a "gallery". Now, I need to create a
page in the admin area that they can visit and then some UI to do the
selecting.
I then need to create, eg. gallery.php which is accessible on
their site for me to pull in those selected images and output them.
Now I can do the grabbing bit, but it's the admin area bit I'm
struggling to think how to approach. And how would you store the
images? Would you tag them in the Media Library as "gallery" and
then use a WP function to grab all images with tag of "gallery"?
All advice appreciated!
@maxshelley
Copy link

You might want to try the 'gallery' addon to the Advanced Custom Fields from Eliot Condon. http://www.advancedcustomfields.com/add-ons/gallery-field/ - Not sure it meets all your needs, but it's well worth a look.

You could create a 'gallery' field on an 'options' page (both of which ACF provide), then the images that the user picks aren't attached to a page or post, but you can still grab them from an array anywhere on the site.

@HelloTiago
Copy link

If I understood correctly and what you need is the functionality to create a gallery, add images to it and place it on a post/page then WordPress supports it by default.

It's was somewhat hidden in WordPress <3.5 but now it's easily accessible. On a post/page click "Add Media" and then on the top left select "Create Galery", add your images and insert it to the post :)

Let me know if that's what you need. If not, I'll try helping with a plugin approach.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment