Skip to content

Filtering the Gallery Image Output in WordPress – Adding Class or Data Attribute

filter-gallery-output-wordpress

To manipulate the linked images, specifically the links themselves in the WordPress Gallery output for doing things like adding in a CSS class or a data attribute value you can use the post_gallery filter in /wp-includes/media.php which is the right tool for the job. The filter can be applied like so… So this is an exact copy of the original…

Read More
Scroll To Top