Last active
August 29, 2015 14:16
-
-
Save verticalgrain/f8a0d0f515ecf3c32df2 to your computer and use it in GitHub Desktop.
Sublime snippet - ACF image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment