Remove Featured Image Field on Posts Edit Screen
-
I am really stumped. I have a site that needs to give the admin the option to put images on pages, but not posts. No matter what I do, I can’t seem to get the Featured Image meta box to disappear. Here is what I’ve tried.
- Copy paste the function from this page (https://developer.ww.wp.xz.cn/reference/functions/remove_theme_support/) into functions.php (I changed
array( 'post' )toarray( 'page' )to re-enable the feature for just pages. - Same as above without re-enabling anything. So, just adding
remove_theme_support( 'post-thumbnails' );to functions.php inside a setup function. - In my parent theme, I found the function that enables the post thumbnails, I commented out that line, no change.
- Searched entire parent theme for
add_theme_supportto be sure it wasn’t enabled somewhere else, this is the only instance - Switched theme to Twenty Nineteen and removed the line for
add_theme_supportfrom functions.php - While keeping the Twenty Nineteen theme, added
remove_theme_support( 'post-thumbnails' );directly belowadd_theme_support( 'post-thumbnails' ); - Same as above with
add_theme_support( 'post-thumbnails' );NOT commented out
I don’t get it. It’s like the feature is permanent. I’ve played around with the priority, but the more direct method seems like it doesn’t work anyway. Anything that points me in the direction of what I’m missing would be greatly appreciated.
The only other thing to mention is that I am not looking for a CSS fix. This is a site for a client, I don’t want to have a meta box on the admin side that doesn’t do anything. As a last resort, I can hide it with CSS on the admin side, but I’d rather find the right way to do it.
Swani
- Copy paste the function from this page (https://developer.ww.wp.xz.cn/reference/functions/remove_theme_support/) into functions.php (I changed
The topic ‘Remove Featured Image Field on Posts Edit Screen’ is closed to new replies.