Last active
August 29, 2015 13:56
-
-
Save amdrew/8982224 to your computer and use it in GitHub Desktop.
Easy Image Gallery - filter the gallery to simply link to the image's attachment page. If you want to add a CSS class for styling, uncomment out the line below and change my-class accordingly
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
<?php | |
function sumobi_easy_image_gallery_html( $html, $rel, $image_link, $image_class, $image_caption, $image, $attachment_id, $post_id ) { | |
// $image_class = 'class="my-class"'; // uncomment this if you'd like to add a CSS class to the anchor link | |
$image_link = get_attachment_link( $attachment_id ); | |
$html = sprintf( '<li><a href="%s" %s title="%s">%s</a></li>', $image_link, $image_class, $image_caption, $image ); | |
return $html; | |
} | |
add_filter( 'easy_image_gallery_html', 'sumobi_easy_image_gallery_html', 10, 8 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment