cristiansans (owner)

Revisions

gist: 183993 Download_button fork
public
Public Clone URL: git://gist.github.com/183993.git
Embed All Files: show embed
wp image functions 2 #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Get thumbnail
function get_thumb() {
$files = get_children('post_parent='.get_the_ID().'&post_type=attachment&post_mime_type=image');
  if($files) :
    $keys = array_reverse(array_keys($files));
    $j=0;
    $num = $keys[$j];
    $image=wp_get_attachment_image($num, 'large', false);
    $imagepieces = explode('"', $image);
    $imagepath = $imagepieces[1];
    $thumb=wp_get_attachment_thumb_url($num);
    print $thumb;
  endif;
}