Created
August 30, 2012 03:16
-
-
Save bondarolik/3521980 to your computer and use it in GitHub Desktop.
Add rel="fancybox" to wp_attachments
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_filter( 'wp_get_attachment_link', 'add_fancybox_rel'); | |
function add_fancybox_rel ($content) { | |
// add checks if you want to add prettyPhoto on certain places (archives etc). | |
return str_replace('<a', '<a rel="fancybox"', $content); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment