Adding Class to WordPress Image Gallery

September 6th, 2013 by

Add the following code to the functions.php

add_filter('wp_get_attachment_link', 'rc_add_rel_attribute');
function rc_add_rel_attribute($link) {
global $post;
return str_replace('<a href', '<a rel="prettyPhoto[pp_gal]" href', $link);
}

Post a Comment

You must be logged in to post a comment.

Cached at: 2024-12-22 07:25:56am