Galleries are an awesome way to show simple pictures in your posts. In this tutorial we will create a WordPress gallery that will show on the post on which we create it. We will also be able to decide the order of the images in our gallery. The gallery will be attached to a single post so we will have to create a metabox for each post in the admin area where we will insert the gallery images. Interested? Let’s begin:) All the code you find here can be used in any of your projects both personal and commercial. We will make a class to handle our WordPress gallery (saving images, loading images, rendering images) and we will also create a class that could be a factory class which will create all the registered galleries. By doing that, we could have two or more galleries on each post. By using the OOP approach you can extend the initial class for the WordPress Gallery and create different gallery rendering. Please do be patient since this is a long article and the galleries will work once we create the necessary JavaScript at the end of this article. If you want to see what we are going to build, you have a video at the bottom of this article. Click here to see it. WordPress Gallery First,
Share This