Skip to content

Instantly share code, notes, and snippets.

@bondarolik
Created August 30, 2012 03:16
Show Gist options
  • Save bondarolik/3521980 to your computer and use it in GitHub Desktop.
Save bondarolik/3521980 to your computer and use it in GitHub Desktop.
Add rel="fancybox" to wp_attachments
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