My site has a good number of different custom post types like Courses, Woocommerce Products, Lessons, bbpress topics and several others.
The Customizer menu for my theme has the option for enabling or disabling the featured image on “posts” and “pages”. But I want to display the featured image only in a certain post type (say for Courses).
So is there any way that I can turn off displaying featured images for posts and make an exception for a certain custom post type?
Or any other way to display featured image only in a specific custom post type?
I want to show full-width featured image only in custom post type “Course”. I don’t want any other posts (or custom post type) to show the featured image.
Thanks in Advanced.
]]>get_post_type()
function and call featured thumbnail only when it matches your desired post type.if ( "Course" === get_post_type() ) {
the_post_thumbnail();
}
]]>
Here is a page where I choose not to display featured image: https://www.bohubrihi.com/course/introduction-to-graphic-design
]]>