Hi!
First of all, thanks for your kind words. I really appreciate your liking our plugin 🙂
In order to add an external featured image, our plugin applies a few tricks:
First of all, it assumes that a certain WordPress function is used for rendering the featured image. In particular, it only works if (get_)the_post_thumbnail is used, because it’s the only one we can hook into. If other functions (such as a combination of wp_get_attachment_image_src and get_post_thumbnail_id) are used, then the plugin doesn’t work.
Second, the (external) featured image is rendered using an img tag whose src attribute is a transparent gif. The actual featured image is set via CSS, setting it as the background property of said img tag. Using this approach, we can scale the transparent gif to the proper size and the actual featured image (which is set via CSS background, remember) can be scaled and cropped properly, without losing its aspect ratio.
That probably explains why pinning a featured image returns this:
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH...
This is a 1px transparent gif image.
Now, by looking at the snippet you shared, it looks like you can manually set the image that has to be pinned. If you look closely at it, you’ll realize it uses the two functions I said our plugins is not compatible with: wp_get_attachment_image_src and get_post_thumbnail_id. One possible solution can be the following:
...
$img = wp_get_attachment_image_src(get_post_thumbnail_id(),'full');
if ( function_exists( 'uses_nelioefi' ) and uses_nelioefi( get_the_ID() ) {
$img = array( nelioefi_get_thumbnail_src( get_the_ID ) );
}
...
As you can see, we simply add a tiny if clause after the $img variable is initialized. This is what we’re doing: we check if the current post has an external featured image set and, if it does, we overwrite the $img variable so that it contains the actual featured image.
Try to apply the previous tweak and let us know if it solved your issue.
All the best,
David