Nael
4/7/2020 - 8:10 PM

Hide WP Featured image from front page

function hide_featured_image() {
    $post_id = $_GET['post'] ?? ( $_POST['post_ID'] ?? false );
    if ( ! isset( $post_id ) ) {
        return;
    }

    $frontpage_id = get_option( 'page_on_front' );

    if ( $post_id === $frontpage_id ) {
        remove_post_type_support( 'page', 'thumbnail' );
    }
}
add_action( 'admin_init', 'hide_featured_image' );