Easy Image Gallery can either open your gallery images in a lightbox, or simply display them with no links. A user contacted me today asking if it’s possible to link each image to the attachment page, instead of using the lightbox functionality.

To do this, copy the following function into your child theme’s functions.php (mind the opening PHP tag) or custom plugin:

Note: if you need to add a CSS class on the anchor link, simply comment out the line of code shown in the code snippet and edit accordingly.

You can download Easy Image Gallery from WordPress.org.

One comment

Comments are closed.