SHARE
TWEET

Untitled

a guest Mar 20th, 2019 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $image = get_field( 'image' );
  3.  
  4. if ( ! empty( $image ) ) {
  5.     // thumbnail
  6.     $size  = 'medium';
  7.     $thumb = $image['sizes'][ $size ];
  8. } else {
  9.     $thumb = '/wp-content/uploads/2019/01/placeholder.jpg';
  10. } ?>
  11.  
  12. <div class="lozad" data-background-image="<?= $thumb ?>" style="background-repeat: no-repeat; background-position: center; background-size: cover;"></div>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top