Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Sublime text snippet for calling an advanced custom fields image in a Wordpress theme file -->
- <snippet>
- <content><![CDATA[
- <?php \$image = get_field('${1:acf_field_id}');
- if( !empty(\$image) ): ?>
- <img src="<?php echo \$image['sizes']['${2:thumbnail}']; ?>" alt="<?php echo \$image['title']; ?>" />
- <?php endif; ?>
- $0
- ]]></content>
- <tabTrigger>image</tabTrigger>
- <!-- <scope>source.php</scope> -->
- </snippet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement