Last active
September 6, 2019 16:51
-
-
Save mgibbs189/611f99874937896ea0a8c09d869e7199 to your computer and use it in GitHub Desktop.
Output an attachment thumbnail
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
<?php | |
// Add the following into the custom-hooks.php file | |
add_filter( 'facetwp_builder_item_value', function( $value, $item ) { | |
global $post; | |
if ( 'attachment' == $item['settings']['name'] ) { | |
$value = wp_get_attachment_image( $post->ID ); | |
} | |
return $value; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment