Hello all,
I need exactly what the title says: to add the rel="prettyPhoto" attribute into the gallery output via functions.php. This way I can take advantage of the lightbox feature I already have, without using a plugin.
Utkarsh Kukreti answers:
add_filter( 'wp_get_attachment_link', 'gallery_prettyPhoto');
function gallery_prettyPhoto ($content) {
// add checks if you want to add prettyPhoto on certain places (archives etc).
return str_replace("<a", "<a rel='prettyPhoto'", $content);
}