Search code examples
wordpresscustom-fieldscustom-theme

Featured Image & Custom Fields not showing in Wordpress Custom Post Type (CPT)


In my Wordpress back-end, under my Custom Post Type for "Business", I want to enable the Featured Image and Custom-Fields in my "Screen Options", however, there is no option there. See screenshot: Screen Options in Add New Post for Custom Post Type "Business"

I am using the Understrap framework, building a custom theme using the Understrap child theme.

function custom_post_business() {
    $args = array(
        'public' => true,
        'has_archive' => true,
        'description' => 'Local Businesses for use in the Business Directory',
        'support' => array('title', 'editor', 'thumbnail', 'custom-fields', 'revisions'),
        'menu_icon' => 'dashicons-store',
        'labels' => array(
                'name' => 'Businesses',
                'singular_name' => 'Business',
        ),
    );
    register_post_type('businesses', $args);

}
add_theme_support('post-thumbnails', array('businesses'));
add_action('init', 'custom_post_business');
  1. I have tried adding the theme support, as suggested in almost ALL of the threads pertaining to this issue.
  2. I have tried disabling ALL plugins to see if there is a conflict.
  3. I am aware I can try using ACF or Carbon Fields plugin, but I would like to try to avoid plugins if possible. (I will be using Carbon Fields if I cannot find a fix.)

Thanks in advance!


Solution

  • Reason for error: forgotten 's' in 'supports' (pluralized)

    'support' => array('title', 'editor', 'thumbnail', 'custom-fields', 'revisions'),
    

    You should replace to below:

    'supports' => array('title', 'editor', 'thumbnail', 'custom-fields', 'revisions'),
    

    (Note "supports" is plural)