Created
March 16, 2015 04:00
-
-
Save besimhu/eaff17710834576017a1 to your computer and use it in GitHub Desktop.
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
/** | |
* Generate image markup through WP function. | |
* | |
* Requires ACF setting of ID. | |
* The crop can be custom, or one of WP default ones, or leave empty. | |
* | |
* This method does not work great with Media Query Sync. However, this method | |
* allows you to define custom settings, and the width, height, and alt tags will | |
* be auto generated for you. Which is great for semantics. | |
* | |
* wp_get_attachment_image( $attachment_id, $size, $icon, $attr ); | |
* http://codex.wordpress.org/Function_Reference/wp_get_attachment_image | |
*/ | |
<?php echo wp_get_attachment_image( $image_field, 'image_crop', '0', array('class' => '') ); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment