Title: Remove from single pages posts&#8230;.
Last modified: December 4, 2016

---

# Remove from single pages posts….

 *  Resolved [pinokio](https://wordpress.org/support/users/lapanwebsite/)
 * (@lapanwebsite)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/remove-from-single-pages-posts/)
 * What function to add in functions.php to remove it from single posts and single
   pages?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [pinokio](https://wordpress.org/support/users/lapanwebsite/)
 * (@lapanwebsite)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/remove-from-single-pages-posts/#post-8513300)
 * function dfi_posttype_page ( $dfi_id, $post_id ) {
    $post = get_post($post_id);
   if ( ‘page’ === $post->post_type ) { return 0; //invalid ID } elseif ( ‘post’
   === $post->post_type ) { return 0; //invalid ID } return $dfi_id; // the original
   featured image id } add_filter( ‘dfi_thumbnail_id’, ‘dfi_posttype_page’, 10, 
   2 );
 *  Plugin Author [Jan-Willem](https://wordpress.org/support/users/janwoostendorp/)
 * (@janwoostendorp)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/remove-from-single-pages-posts/#post-8514650)
 * Yep that’s it. It can be a bit shorter.
 *     ```
       function dfi_posttype_page ( $dfi_id, $post_id ) {
         if ( is_single($post_id) || is_page($post_id) ) {
           return 0; //invalid ID
         }
         return $dfi_id; // the original featured image id
       }
       add_filter( ‘dfi_thumbnail_id’, ‘dfi_posttype_page’, 10, 2 );
       ```
   
    -  This reply was modified 9 years, 6 months ago by [Jan-Willem](https://wordpress.org/support/users/janwoostendorp/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Remove from single pages posts….’ is closed to new replies.

 * ![](https://ps.w.org/default-featured-image/assets/icon-256x256.jpg?rev=1058491)
 * [Default Featured Image](https://wordpress.org/plugins/default-featured-image/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/default-featured-image/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/default-featured-image/)
 * [Active Topics](https://wordpress.org/support/plugin/default-featured-image/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/default-featured-image/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/default-featured-image/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jan-Willem](https://wordpress.org/support/users/janwoostendorp/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/remove-from-single-pages-posts/#post-8514650)
 * Status: resolved