Hi Penjetti!
First of all, thanks for getting in touch and letting us know that there might be something amiss. NelioEFI and Nelio Content follow a slightly different approach for inserting featured images.
When you upload a regular image in your media library, this image will be automatically scaled and cropped to match the requirements defined by your theme. External featured images, on the other hand, can’t be scaled and cropped because they’re stored outside of WordPress.
NelioEFI assumed that the dimensions of the image would be set using CSS rules solely. This worked fine with some themes, but had trouble with others. Nelio Content, on the other hand, uses a placeholder that your theme crops and scales and uses it to define the exact area that the featured image is supposed to take. This ensures that the dimensions of your image will match the requirements of your theme. As far as I can tell, Nelio Content offers better results than NelioEFI, and that’s why we decided to apply the shift.
If you want to use the old approach for inserting featured images, add the following snippet in functions.php
(or a custom plugin):
function nc_use_old_efi_style( $html, $post_id, $size = false, $attr = array() ) {
$aux = Nelio_Content_External_Featured_Image_Helper::instance();
$nelio_featured_image = $aux->get_nelio_featured_image( $post_id );
if ( ! is_string( $nelio_featured_image ) || ! strlen( $nelio_featured_image ) ) {
return $html;
}//end if
// Fix the alt tag (if possible).
$alt = $aux->get_external_featured_alt( $post_id );
if ( isset( $attr['alt'] ) ) {
$alt = $attr['alt'];
}//end if
if ( empty( $alt ) ) {
$alt = '';
}//end if
preg_match( '/class="([^"]*)"/', $html, $matches );
$classes = '';
if ( count( $matches ) > 1 ) {
$classes = $matches[1];
}//end if
return sprintf(
'<img src="%s" alt="%s" class="%s" />',
esc_url( $nelio_featured_image ),
esc_attr( $alt ),
esc_attr( $classes )
);
}//end maybe_add_efi_as_background()
add_filter( 'post_thumbnail_html', 'nc_use_old_efi_style', 20, 4 );
Let me know if this helped!