Created
September 6, 2013 01:36
-
-
Save bMinaise/6458477 to your computer and use it in GitHub Desktop.
Wordpress Get Galleries
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
$gallery = get_post_gallery( $post, false ); | |
$ids = explode( ",", $gallery['ids'] ); | |
foreach( $ids as $id ) { | |
$link = wp_get_attachment_url( $id ); | |
$image = wp_get_attachment_image( $id, "thumbnail"); | |
echo( "<div class='item'><a href='$link'>" . $image . "</a></div>" ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment