Galleries

WordPress has an excellent built in gallery, there is no need to install a plugin. But WordPress does have some funny ideas on how to style a gallery so I just set my own by adding a filter to the theme and adding some CSS in the customizer

The filter you need is:

add_filter( ‘use_default_gallery_style’, ‘__return_false’ );

In the customizer go to the ‘Additional CSS’ option and add the following:

#gallery-1 img {padding: 2.5% 0 1% 3%;margin:0;}
#gallery-1 {padding:0 1% 0 0;background: #FFF;}
.gallery-item {margin:0 !important;float: left;text-align: center;width: 33.3%;}

This CSS is for a three column gallery. For different number just change the ‘width’ style. For example: 5 columns would be width: 20%;

Add your comment

Web Analytics