Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $media_items = get_attachments_by_media_tags('media_tags=$tag-name&size=thumb');
- if ($media_items) {
- echo '<ul>';
- foreach ($media_items as $mymedia) {
- $fullSize = wp_get_attachment_url($mymedia->ID);
- $thumbnail = wp_get_attachment_thumb_url($mymedia->ID, 'thumb');
- echo '<li><a href="' . $fullSize . '" rel="shadowbox[set1]" title="Fullscreen" ><img src="'.$thumbnail.'" /></a>
- <span>This photo belongs to post: <a href="/summer-holiday">Summer holiday</a>, <a href="/best-of-2012">Best of 2012</a></span>
- </li>'; }
- echo '</ul>'; } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement