Guest User

Untitled

a guest
May 21st, 2014
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. foreach ( $images as $attach_id ) {
  2. $i++;
  3. if ($attach_id > 0) {
  4. $post_thumbnail = wpb_getImageBySize(array( 'attach_id' => $attach_id, 'thumb_size' => $img_size ));
  5. $post_thumbnail_link = wp_get_attachment_image_src( $attach_id, 'full');
  6. }
  7. else {
  8. $different_kitten = 400 + $i;
  9. $post_thumbnail = array();
  10. $post_thumbnail['thumbnail'] = '<img src="http://placekitten.com/g/'.$different_kitten.'/300" />';
  11. $post_thumbnail['p_img_large'][0] = 'http://placekitten.com/g/1024/768';
  12.  
  13. $post_thumbnail_link = array();
  14. $post_thumbnail_link[0] = null;
  15. }
  16.  
  17. $thumbnail = $post_thumbnail['thumbnail'];
  18. $p_img_large = $post_thumbnail['p_img_large'];
  19. $link_start = $link_end = '';
  20.  
  21. if ( $onclick == 'link_image' ) {
  22. $link_start = '<a href="'.$post_thumbnail_link[0].'"'.$pretty_rel_random.'>';
  23. $link_end = '</a>';
  24. }
Advertisement
Add Comment
Please, Sign In to add comment