Title: Featured image only on posts
Last modified: December 20, 2018

---

# Featured image only on posts

 *  Resolved [ars111](https://wordpress.org/support/users/ars111/)
 * (@ars111)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/featured-image-only-on-posts/)
 * Hi, when I enable your plugin, it shows featured image on posts. That part is
   working excellent, but the problem is it is showing image on pages. That image
   is not featured but first image under the title part. I’m using Avada theme.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffeatured-image-only-on-posts%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Jan-Willem](https://wordpress.org/support/users/janwoostendorp/)
 * (@janwoostendorp)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/featured-image-only-on-posts/#post-11011040)
 * Hi,
 * I’m not totally surewhat you want but the following snippet will exclude all 
   pages from the default featured image.
 *     ```
       <?php
       /**
        * Don't show DFI on pages posttype
        * https://wordpress.org/support/topic/featured-image-only-on-posts/
        */
       function dfi_support_no_pages ( $dfi_id, $post_id ) {
         $post = get_post($post_id);
         if ( 'page' === $post->post_type ) {
           return 0; // false image id
         }
         return $dfi_id; // the original featured image id
       }
       add_filter( 'dfi_thumbnail_id', 'dfi_support_no_pages', 10, 2 );
       ```
   
 * create a file in wp-content/mu-plugins/dfi_support_no_pages.php And paste this
   code inside.
    (mu-plugins folder might not exist yet)
 *  Plugin Author [Jan-Willem](https://wordpress.org/support/users/janwoostendorp/)
 * (@janwoostendorp)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/featured-image-only-on-posts/#post-11029164)
 * Hi,
 * Did this work?
    For now I’m setting this issue to resolved.
 *  [REKOMENDASI SAHAM](https://wordpress.org/support/users/sahamdotnews/)
 * (@sahamdotnews)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/featured-image-only-on-posts/#post-11091940)
 * it wont work, error code
    still showing [https://saham.news/submit](https://saham.news/submit)
 * Any idea how to disable the featured image on all pages by feature only or code
   php?
    -  This reply was modified 7 years, 4 months ago by [REKOMENDASI SAHAM](https://wordpress.org/support/users/sahamdotnews/).
 *  [Keezie](https://wordpress.org/support/users/keezie/)
 * (@keezie)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/featured-image-only-on-posts/#post-11105604)
 * I found this thread by googling this exact issue. Your code worked for me Jan,
   thank you very much!
 * Is this something that could be easily implemented with a future update? A checkbox
   to change this feature would be great for folks who aren’t comfortable with code
 *  Plugin Author [Jan-Willem](https://wordpress.org/support/users/janwoostendorp/)
 * (@janwoostendorp)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/featured-image-only-on-posts/#post-11112843)
 * Hi [@sahamdotnews](https://wordpress.org/support/users/sahamdotnews/),
 * Sorry for the late replay I was unavailable.
    You say you get an error, can you
   share the exact error message? The code I provided should exclude all pages.
 *  Plugin Author [Jan-Willem](https://wordpress.org/support/users/janwoostendorp/)
 * (@janwoostendorp)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/featured-image-only-on-posts/#post-11112846)
 * [@keezie](https://wordpress.org/support/users/keezie/) Good to hear this worked.

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

The topic ‘Featured image only on 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/)

 * 6 replies
 * 4 participants
 * Last reply from: [Jan-Willem](https://wordpress.org/support/users/janwoostendorp/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/featured-image-only-on-posts/#post-11112846)
 * Status: resolved