Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter hrithik951

    (@hitesh4317)

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

    I really don’t want the featured images to appear on pages. The code above removes it from everywhere.

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hello,

    Glad to hear you figured this out ??

    Thread Starter hrithik951

    (@hitesh4317)

    no, I didn’t. It was for your convenience, I only want to remove default featured from pages, the above code removes from everywhere.

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Sorry, I didn’t see your reply.

    I think you have a typo in the code.

    You renamed the function to dfi_posttype_page but in the add_filter you still have dfi_posttype_book.

    Can you try that?

    Let me know
    Jan-Willem

    Hi Jan-Willem,
    I’m not hrithik951, but for our project it works like charm. ??
    Thank you for your great plugin! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘displayed on pages’ is closed to new replies.