Advertisement
fayway

zockah

Jan 17th, 2012
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.61 KB | None | 0 0
  1. <?php if (has_post_thumbnail()) {
  2.     if(function_exists('get_wp_lazy_loading_blank_image')){
  3.         $post_thumbnail_id = get_post_thumbnail_id( get_the_ID() );
  4.         $image_attributes = wp_get_attachment_image_src( $post_thumbnail_id );
  5.     }
  6.     ?>
  7.     <?php if (get_current_template() == 'template-blog3.php') { ?>
  8.         <div class="full-width-image hover-image">
  9.              <a href="<?php the_permalink(); ?>">
  10.                 <?php if(function_exists('get_wp_lazy_loading_blank_image')){
  11.                     $default_attr = array(
  12.                             'src'   => get_wp_lazy_loading_blank_image(),
  13.                             'class' => 'attachment-showcase-image wp-post-image lazy',
  14.                             'data-original' => $image_attributes[0]
  15.                     );
  16.                     the_post_thumbnail('showcase-image', $default_attr);
  17.                     ?> 
  18.                 <?php } else {
  19.                     the_post_thumbnail('showcase-image');
  20.                 }
  21.                 ?>
  22.              </a>
  23.         </div>
  24.     <?php } else { ?>
  25.         <div class="main-post-image hover-image">
  26.             <a href="<?php the_permalink(); ?>">
  27.                 <?php if(function_exists('get_wp_lazy_loading_blank_image')){
  28.                     $default_attr = array(
  29.                             'src'   => get_wp_lazy_loading_blank_image(),
  30.                             'class' => 'attachment-thumb-image wp-post-image lazy',
  31.                             'data-original' => $image_attributes[0]
  32.                     );
  33.                     the_post_thumbnail('thumb-image', $default_attr);
  34.                     ?> 
  35.                 <?php } else {
  36.                     the_post_thumbnail('thumb-image');
  37.                 }
  38.                 ?>
  39.             </a>
  40.         </div>
  41.     <?php } ?>
  42. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement