• Resolved pinokio

    (@lapanwebsite)


    If is nelio featured image set while there is activated plugin default featured image it will post default featured image untill that plugin is deactivated and activated again.

    One guy asked developer of default featured image plugin, and he says he has no time but it can be done with post type function that he offere.
    https://www.ads-software.com/plugins/default-featured-image/faq/

    function dfi_posttype_book ( $dfi_id, $post_id ) {
      $post = get_post($post_id);
      if ( 'POSTTYPE' === $post->post_type ) {
        return 31; // the image id
      }
      return $dfi_id; // the original featured image id
    }
    add_filter( 'dfi_thumbnail_id', 'dfi_posttype_book', 10, 2 );

    Can you please tell me how to make it work?

    https://www.ads-software.com/plugins/external-featured-image/

Viewing 1 replies (of 1 total)
  • Plugin Author David Aguilera

    (@davilera)

    Hi!

    Just add the following function in your theme’s functions.php file:

    function nelioefi_fix_filters() {
      remove_filter( 'post_thumbnail_html', 'nelioefi_replace_thumbnail', 10, 5 );
      add_filter( 'post_thumbnail_html', 'nelioefi_replace_thumbnail', 99, 5 );
    }//end nelioefi_fix_filters()
    add_action( 'init', 'nelioefi_fix_filters' );
    

    Apparently, the Default Featured Image plugin and ours (Nelio External Featured Image) use the same WordPress filter for setting the featured image of a post: post_thumbnail_html. By default, DFI was executed after NelioEFI, overwriting our external featured image and using the default featured image instead. Changing NelioEFI’s hook priority from 10 to 99 solves the issue.

    Enjoy!

Viewing 1 replies (of 1 total)
  • The topic ‘Nelio and Default featured image.’ is closed to new replies.