Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <?php
  2.  
  3. function gd_get_image1 ($gd_w, $gd_h) {
  4. if ( function_exists( 'get_the_image' ) )
  5.                             global $post, $posts;
  6.                             $get_the_image_as_array = get_the_image( array( 'image_scan' => true, 'format' => 'array' ) );
  7.                             $img1 = $get_the_image_as_array[url];
  8.                             $url = get_bloginfo('url');
  9.                             $img1 = str_replace($url, '', $img1);
  10.  
  11.                             echo '<a href="'.post_permalink().'">
  12.                             <img src="'.get_bloginfo("template_url").'/thumb.php?src='.$img1.'&w='.$gd_w.'&h='.$gd_h.'&zc=1 />" alt="'.$get_the_image_as_array[alt].'"/>
  13.                             </a>';
  14. }
  15. ?>
  16. // the call
  17. <?php function gd_get_image1 (120, 80); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement