Advertisement
Guest User

Untitled

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