Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Last active September 6, 2019 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgibbs189/611f99874937896ea0a8c09d869e7199 to your computer and use it in GitHub Desktop.
Save mgibbs189/611f99874937896ea0a8c09d869e7199 to your computer and use it in GitHub Desktop.
Output an attachment thumbnail
<?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