• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Add featured image support to custom post type in Executive Pro

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Add featured image support to custom post type in Executive Pro

This topic is: not resolved
  • This topic has 7 replies, 3 voices, and was last updated 12 years, 1 month ago by seezee.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • August 8, 2014 at 9:30 am #117771
    seezee
    Member

    I'm customizing the Executive Pro child-theme for a client, and I've
    created a custom post-type. I've made a plugin to extend
    the custom theme (rather than using functions.php), having this line of
    code:

    'supports' => array( 'title', 'editor', 'excerpt', 'author',
    'thumbnail', 'custom-fields', 'revisions', 'genesis-cpt-archives-settings'
    ),

    However, the featured image meta doesn't show up in
    the list of available items for the post-type under screen options. The
    post type does grab a thumbnail in the archive page, but it's a random (?)
    pick from the uploaded images attached to the page -- I have no control
    over which one it uses.

    I'm working with a COPY of Executive, renamed as a custom
    Genesis child theme, since I needed to place a custom.css in the directory and also
    needed to be able to edit the functions.php and didn't want theme updates
    to overwrite my changes.

    I've tried this code, alternatively, in both functions.php and in my plugin, with no joy:

    add_theme_support( 'post-thumbnails', array( 'page', 'post',
    'cm_product' ) );

    as well as the simpler

    add_theme_support( 'post-thumbnails' );

    I could sure use some help with this; thanks.

    August 8, 2014 at 2:37 pm #117816
    Summer
    Member

    I have a site with CPTs I created with the CPT UI plugin, and the Featured Image meta shows up in there just fine. I even checked the code to see what it used to create the CPT and have 'thumbnail' in 'supports' is correct.

    What does the full code for your CPT look like?

    Also, any child theme updates that StudioPress would make to Executive Pro would not be automatically pushed out, so that's not something you'd have to worry about.


    WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
    Slice of SciFi | Writers, After Dark

    August 11, 2014 at 9:14 am #118193
    seezee
    Member

    Here's the relevant portion of the code (the plugin has other stuff related to the site that I'm omitting here):

    // Register Custom Post Type
    function cm_product_post_type() {
    
    	$labels = array(
    		'name'                => _x( 'Products', 'Post Type General Name', 'text_domain' ),
    		'singular_name'       => _x( 'Product', 'Post Type Singular Name', 'text_domain' ),
    		'menu_name'           => __( 'Product', 'text_domain' ),
                    'parent_item_colon'   => __( 'Parent Product:', 'text_domain' ),
    		'all_items'           => __( 'All Products', 'text_domain' ),
    		'view_item'           => __( 'View Product', 'text_domain' ),
    		'add_new_item'        => __( 'Add New Product', 'text_domain' ),
    		'add_new'             => __( 'New Product', 'text_domain' ),
    		'edit_item'           => __( 'Edit Product', 'text_domain' ),
    		'update_item'         => __( 'Update Product', 'text_domain' ),
    		'search_items'        => __( 'Search products', 'text_domain' ),
    		'not_found'           => __( 'No products found', 'text_domain' ),
    		'not_found_in_trash'  => __( 'No products found in Trash', 'text_domain' ),
    	);
    	$args = array(
    		'label'               => __( 'product', 'text_domain' ),
    		'description'         => __( 'Product information pages', 'text_domain' ),
    		'labels'              => $labels,
    		'rewrite'             => array('slug' => 'products'),
    		'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'custom-fields', 'revisions', 'genesis-cpt-archives-settings' ),
    		'taxonomies'          => array( 'category', 'post_tag' ),
    		'hierarchical'        => false,
    		'public'              => true,
    		'show_ui'             => true,
    		'show_in_menu'        => true,
    		'show_in_nav_menus'   => true,
    		'show_in_admin_bar'   => true,
                    'menu_icon'           => '',
                    'menu_position'       => 5,
    		'can_export'          => true,
    		'has_archive'         => true,
    		'exclude_from_search' => false,
    		'publicly_queryable'  => true,
    		'capability_type'     => 'page',
    	);
    	register_post_type( 'cm_product', $args );
    
    }
    
    // Hook into the 'init' action
    add_action( 'init', 'cm_product_post_type', 0 );
    
    // Customize the Admin Menu (add icons for product post type menu)
    function add_menu_icons_styles(){
    ?>
    
    	<style>
    		#adminmenu .menu-icon-cm_product div.wp-menu-image:before {
    			content: "\f312";
    		}	
    	</style>
    
    <?php
    }
    
    add_action( 'admin_head', 'add_menu_icons_styles' );
    
    /**
    *
    * Add featured image thumbnail to posts and pages
    *
    */
    
    // Add new image size
    add_image_size( 'singular', 680, 510, TRUE );
    
    add_action ( 'genesis_entry_header', 'cm_featured_image_title_singular' );
    function cm_featured_image_title_singular() {
    
    	if ( !is_singular() || !has_post_thumbnail() )
    		return;
    
    	echo '<div class="singular-thumbnail">';
    	genesis_image( array( 'size' => 'singular' ) );
    	echo '</div>';
    
    }

    True that the auto-update wouldn't overwrite changes, but I'm going to be doing several sites for the client all based on Ex. Pro, so each needs its own child theme.

    August 29, 2014 at 4:27 pm #121753
    seezee
    Member

    Anyone ever figure this out?

    August 29, 2014 at 11:04 pm #121786
    Summer
    Member

    I don't see anything that sticks out as being incorrect. Have you tried putting the code to register the post type in functions.php, just to test out if the code works as expected there? Maybe there's something off about how your plugin is trying to set things up?

    Executive Pro shouldn't need the add_theme_support calls, since it already supports them (at least my copy did, out of the box).


    WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
    Slice of SciFi | Writers, After Dark

    August 30, 2014 at 1:09 am #121795
    Brad Dalton
    Participant

    Check this line

    'supports' => array( 'title', 'editor', 'author', 'thumbnail',  'genesis-cpt-archives-settings' ),
    

    Tutorials for StudioPress Themes.

    August 30, 2014 at 8:35 am #121864
    seezee
    Member

    Have you tried putting the code to register the post type in functions.php, just to test out if the code works as expected there? Maybe there’s something off about how your plugin is trying to set things up?

    Not yet. I'll give it a go & report back the results.

    September 24, 2014 at 9:53 am #125547
    seezee
    Member

    Weird discovery — if I log out as Network Admin and log back in as a regular Admin, the featured image meta is available.

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble