• Resolved drummergirl

    (@drummergirl)


    This is a weird issue. I have 4 custom post types. The first 3 work great. The 4th one, added last night by copy/pasting one of the previous types and changing the names will not show the featured image box for anything. It’s not anywhere on the editing screen nor is it listed in the screen options panel.

    I’ve done the following with no results:
    -Disabled all plugins
    -Changed Themes
    -Changed the name of the custom post type
    -Flushed Permalinks

    Here is the one that works:

    add_action('init', 'gifts_register_post_type'); 
    
    function gifts_register_post_type() {
    
    register_post_type(
        'gifts', array(
            'labels' => array(
                'name' => 'Gifts',
                'singular_name' => 'Gift',
                'add_new' => 'Add new gift',
                'edit_item' => 'Edit gift',
                'new_item' => 'New gift',
                'view_item' => 'View gift',
                'search_items' => 'Search gifts',
                'not_found' => 'No gifts found',
                'not_found_in_trash' => 'No gifts found in Trash'
            ),
            'public' => true,
            'supports' => array(
                'title',
                'editor',
                'excerpt',
                'custom-fields',
                'revisions',
                'thumbnail'
            ),
            'has_archive' => true,
            'taxonomies' => array()
        )
    );

    And here is the copy of that code that does not:

    add_action('init', 'products_register_post_type'); 
    
    function products_register_post_type() {
    
    register_post_type(
        'products', array(
            'labels' => array(
                'name' => 'Products',
                'singular_name' => 'Product',
                'add_new' => 'Add new product',
                'edit_item' => 'Edit product',
                'new_item' => 'New product',
                'view_item' => 'View product',
                'search_items' => 'Search product',
                'not_found' => 'No products found',
                'not_found_in_trash' => 'No products found in Trash'
            ),
            'public' => true,
            'supports' => array('title',
               'title',
                'editor',
                'excerpt',
                'custom-fields',
                'revisions',
                'thumbnail'
            ),
            'has_archive' => true,
            'taxonomies' => array()
        )
    );

    The first custom post type “gifts” works great. The featured image shows up just fine.

    This is also in my functions.php file :

    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 210, 210, true );

    Any thoughts on what to try next? I’m completely at a dead end here. :/

Viewing 3 replies - 1 through 3 (of 3 total)
  • I copy pasted the products one into a functions.php file on a local dev site (with a closing bracket) and it worked fine.

    Thread Starter drummergirl

    (@drummergirl)

    Thanks for checking. I’m going to clone the whole site to my test server for debugging. Ugh.

    Thread Starter drummergirl

    (@drummergirl)

    Found the problem… I had added another function farther down that was showing the thumbnails in the dashboard overview (list view for posts). It had the line:

    add_theme_support('post-thumbnails', array( 'post', 'page', 'gifts', 'affiliates') );

    Once I added my new post type, the featured image box showed up. Will go clean that up now.

    Doh.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Stumped: Custom Post Featured Image Box Not Showing’ is closed to new replies.