I tested it myself with the code you use and it only works with Gutenburg disabled. It seems to be related to the new editor.
Assuming you want to use the new editor, and depending on your theme and plugins this code may work for you (it worked from my tests):
add_action( 'after_setup_theme', function(){
// this removes the feature image panel from all your post types
// including 'post'
remove_theme_support( 'post-thumbnails' );
// include all post-types that use the featured image panel here
add_theme_support( 'post-thumbnails', array( 'example-post-type' ) );
}, 11 );
Related Posts:
- How to make a image-size selected by default in Media upload – WP v3.5
- Remove “Insert from URL” link in Media upload – WP 3.5
- How to change the wp-login.php page title?
- adding a filter to a shortcode?
- Hide custom image sizes from media library
- Permanently remove first image from posts
- Change the footer text on the login page
- add_filter to post-gallery and remove all ‘s?
- How to overwrite youtube embed?
- Rewriting search and pagination base
- Filter the blog title displayed in the header
- body_class filter – Is there a better way to write this code?
- How to add Shortcode (font awesome) in widget title?
- How To Change The Html of Products filtration sidebar in Woocommerce?
- Filter get_the_title to remove certain characters?
- Wrap First Character after in a tag
- Get posts with at least one category in common with current post?
- Change the site tagline (or similar) based on current page
- WooCommerce Related Products by Attribute
- Custom filter in admin edit custom post type responding with invalid post type?
- add_action shortcut?
- Is it acceptable to treat a filter like an action?
- Edit incorrect password message WordPress
- Add data attribute to each li in menu
- Ajax category filtering products default show all
- Add a specific part of current category page url to shortcode
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- Remove the first 5 characters of the_title and orderby that
- Print last modified date only on posts
- How to add an arrow to menu items has submenus
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- Unique icons next to each WordPress menu item
- Change tinyMCE editor to allow marked content when pasting from Word
- Alter required message using comment form api
- Add filter multiple times using only one master function
- How to edit php code in WordPress Post file?
- Change page title from page using php via php executed from page/post itself
- Override a function defined in wp-includes/comment-template.php
- Filtering a function’ output for a new continued function
- Deleting Certain terms from appearing on the front end as links
- Upload multiple files in randomly generated folder using wp_upload_bits
- Create page template via functions.php?
- Add meta tags to a custom header
- Ajax filter button display all posts
- How to have different site identity logos on each page on Astra Theme [closed]
- Get the_content surrounded by instead of
- Custom query vars filters problem with pagination
- Get the name of menu item with wp_nav_menu
- Displaying content on posts page based on category
- update_post_meta() not saving data inside of save-post filter
- How to add aria role and schema markup to custom walker container
- Can I remove or edit an include() from a function with a filter?
- Dynamically adding filters
- Must filter functions receive all arguments passed to them?
- How to internationalize header image?
- apply_filters with several different values?
- How can I modify this code to make the search box include tags and meta
- User filter posts by year
- How to add a custom filter (by coding) before access one wordpress page ? And where to call the custom filter?
- How to sort WooCommerce products page by latest in-stock items first?
- How do I make these combination select filters work when only one dropdown is set? They work in WordPress 5.8.2 but don’t in 5.8.3
- Variation prices breakdown only for single product page
- How to run php code only for a specific widget on a page and not all widgets on that page?
- How to use apply_filters() inside a plugin class?
- Shortcodes not processing inside post content
- Multiple Tag Filtering
- I want to hide “sold by” on certain pages with id page 43
- Fatal error: Uncaught Error: Class ‘WP_Block_Styles_Registry’
- using filter and hook inside class
- How to bind each “the_content” elements to a custom variables
- Filter portforlio with librairie isotop
- add_filter() inside another add_filter()
- How to filter specific element of an array in wordpress/php?
- How to disable sub menu items from being created?
- Redirecting the lost password page request when using a custon login page
- How can i style “echo apply_filters”
- Custom Bulk Actions handler not firing
- How to generate customized filtered output for the gallery
- Add class to all meta boxes for a custom post type
- Add a leading zero to pagination
- How to apply filter
- Select All not working in a WordPress search filter
- Custom field in title
- WordPress – show all posts + ones with specific tag
- WXR XML import is stripping php tags that I need to keep
- How to add custom checkout field in user details mail template
- Keeping the previous get value and add another value when submitted
- AJAX: WordPress filters inside $html do not work as intended
- Why not showing all post by default in my jquery filter
- Assign new post author IF another user in custom field on post transition
- Blog Posts not sorted and pagination not adjusted after filtering some category
- Add attribute to featured image with filter (wp_get_attachment_image_attributes)
- How to add different menu items on different menus?
- Custom Filtering date with newsletter
- Unable to logout correctly after wp-login file was modified
- how to append ACF field data using one of the following filter/ hooks
- Add an attribute on WP images attachment link
- Show post in elementor based on views and specific category with query id feature in elementor
- Display featured posts first, then display all others within a specific category in WordPress
- Prevent publishing of uncategorized posts