Created
August 8, 2012 08:06
-
-
Save corsonr/3293334 to your computer and use it in GitHub Desktop.
simple trick to add rel attribute to wordpress gallery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ------------------------------------------------------------------*/ | |
/* ADD PRETTYPHOTO REL ATTRIBUTE FOR LIGHTBOX */ | |
/* ------------------------------------------------------------------*/ | |
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice one, thanks. Still working with WP 4.5.2