Center Caption Text Over WordPress Gallery Image

The code in this tutorial enables you to display the image caption for each gallery item over each gallery image.

Here’s the demo tested on the Enterprise Pro child theme by StudioPress:

gallery-captions

Once you’ve created your gallery and added captions to each image in the gallery, you can simply paste the CSS at the end of your child theme’s style.css file.

The CSS includes CSS for Media Queries so the caption always stays centered over the image at every screen width.

You can also link each image in the gallery to any URL.

Note: The gallery used in this tutorial is the WordPress gallery included in the WordPress core. To use this solution with other galleries, you may need to change the classes in the CSS.

Here’s the code for logged in members:

Related Tutorials

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.