Advertisement
Guest User

Untitled

a guest
Apr 20th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. <!-- Sublime text snippet for calling an advanced custom fields image in a Wordpress theme file -->
  2. <snippet>
  3. <content><![CDATA[
  4. <?php \$image = get_field('${1:acf_field_id}');
  5. if( !empty(\$image) ): ?>
  6. <img src="<?php echo \$image['sizes']['${2:thumbnail}']; ?>" alt="<?php echo \$image['title']; ?>" />
  7. <?php endif; ?>
  8. $0
  9. ]]></content>
  10. <tabTrigger>image</tabTrigger>
  11. <!-- <scope>source.php</scope> -->
  12. </snippet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement