• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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:

Register for full access

Related Tutorials

  • Responsive Images Inline Full Screen
  • Show Caption Text Over Gallery Images With Hover Effects

WordPress Gallery

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems