Viewing 1 replies (of 1 total)
  • Plugin Author Jan-Willem

    (@janwoostendorp)

    Hello Ekerton,

    You could put the code in your own theme functions.php. I recommend creating a small plugin.
    wp-content/plugins/dfi-excludepages.php
    Don’t forget to activate it after creating.

    the code should be this:

    /**
     * Plugin Name: DFI exclude pages
     * Plugin URI: https://www.ads-software.com/support/topic/where-to-place-dfi-filter
     * Description: Don't show the default featured image for pages.
     */
    function dfi_ignore_pages ( $dfi_id, $post_id ) {
      $post = get_post($post_id);
      if ( 'page' === $post->post_type ) {
        return 0; // invalid id
      }
      return $dfi_id; // the original featured image id
    }
    add_filter( 'dfi_thumbnail_id', 'dfi_ignore_pages', 10, 2 );

    Let me know how it goes.

    PS. It’s not recommended that you put your own code it plugins of others. If the plugin is updated all your changes will be lost. The same goes for theme’s you didn’t create yourself and for the WordPress code.

Viewing 1 replies (of 1 total)
  • The topic ‘Where to place dfi filter’ is closed to new replies.