On some instances, you may need to show several images in a single post. That is when you need to create a gallery. WordPress comes with a default option to create image galleries without using any plugin.
What’s more, you can create the gallery with any theme. I am using the Appointment theme, a free multi-purpose theme with tons of customization options, but you can use any theme you want.
In today’s post, I will show you how to create a gallery without using any plugin. Are you ready? Let’s get started.
Creating the Image Gallery
To create the gallery, the first step is to add the necessary images. You can add the images by going to Media > Add New. If you have already uploaded the images, you can skip this step.
Once you have the images, go to Posts > Add New. Click the “Add Media” button. On the resulting page, you will notice a “Create Gallery” link on the left side of the page. Click on that link.
At this point, you will be provided with the media files available on your website. Choose the images you want to add to the gallery. Once you have chosen the images, click the “Create a new gallery” button.
This will take you to the next page where you can edit the gallery. This page will show all the images you have selected for the gallery. You can remove any image by clicking the cross icon on that image. There will be a dedicated caption field under each image. It is possible to edit the alt text and description by clicking on the image.
WordPress makes it very easy to choose the order for your gallery. There is a dedicated “Reverse order” button to reverse the images in the gallery. You can create a custom order by dragging and dropping the images to their appropriate place.
There are some additional options on the left and right sides of the page. First of all, you can add more images to the gallery by clicking the “Add to Gallery” link on the left side of the page.
The right side hosts the gallery settings options. You can choose the gallery images to link to the attachment page, media file, or remove the link. Then, you can define how many columns the gallery should have. There will be a checkbox to randomize the images inside the gallery. The last option enables you to choose the size of the images. The available options include Thumbnail, Medium, Large, and Full size.
Once you have made the necessary changes, click the “Insert gallery” button to insert the gallery into your post. This will add the gallery to your post. Publish the post and enjoy your gallery.
Editing the Gallery
It is possible to edit the gallery even after publishing the post. To do that, go to Posts > All Posts, find out the post, and click edit. On the next page, find out the gallery and click on any image inside the gallery. This will provide you with two options – Edit and Remove.
Clicking the edit icon will take you to the gallery editing screen. And the remove icon will let you remove the gallery from the post.
Displaying the Gallery on Other Places
Once you create a gallery inside a post or page, WordPress will generate a shortcode for the gallery. You can use this shortcode to display the gallery on other posts, pages, sidebar, footer, or any widget-enabled section of the website.
To find the gallery shortcode, go to Posts > All Posts. Find the gallery post and click edit. Change the view to “Text” mode. Search for these words – gallery id.
Locate the shortcode and copy the full shortcode. Now, you can use this shortcode to display the gallery in other places.
For instance, you may want to display the gallery on the sidebar. In that case, go to Appearance > Widgets. Find out the text widget and drag it to the sidebar. Provide a title if you want. Paste the copied shortcode into the content.
Click “Save,” and reload your website. You will see the gallery on the sidebar.
And that’s how you create a gallery in WordPress without using any plugin. This will do the job when you don’t need any advanced gallery options, but just want to show a group of images together in a post.
Did I make the process clear for you? Can you create a gallery on your WordPress site without using any plugin? Let me know by leaving a comment below.