• Resolved sunilwilliams

    (@sunilwilliams)


    Untitled declares support for post-thumbnails like this:

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

    This prevents theme support for post-thumbnails in any post types that are not ‘posts’ or ‘pages’.

    I’m working on a child theme.

    Presently the only way to add post-thumbnail support for CPT’s is to directly edit the parent.

    In WordPress editing parent themes is not best practice.

    I request that the theme authors permit theme support for post-thumbnails for custom post types.

Viewing 5 replies - 1 through 5 (of 5 total)
  • I’ll ask our developers to have a look at this and see if it’s something we might change in a future version of Untitled. Thanks for the report.

    Howdy @sunilwilliams!

    You can do this in your child theme by copying the existing untitled_setup() function from the parent theme into your child theme’s functions.php, then changing whatever you like for your child theme’s purposes:

    function untitled_setup() {
    
    	/**
    	 * Make theme available for translation
    	 * Translations can be filed in the /languages/ directory
    	 * If you're building a theme based on untitled, use a find and replace
    	 * to change 'untitled' to the name of your theme in all the template files
    	 */
    	load_theme_textdomain( 'untitled', get_template_directory() . '/languages' );
    
    	/**
    	 * Add default posts and comments RSS feed links to head
    	 */
    	add_theme_support( 'automatic-feed-links' );
    
    	/**
    	 * Enable support for Post Thumbnails
    	 */
    	add_theme_support( 'post-thumbnails', array( 'post', 'page', 'custom-post-type' ) );
    	set_post_thumbnail_size( 150, 150 );
    	add_image_size( 'slider-img', 1440, 400, true );
    	add_image_size( 'content-img', 300, 168, true );
    	add_image_size( 'thumbnail-img', 62, 62, true );
    	add_image_size( 'feat-img', 1000 );
    
    	/**
    	 * This theme uses wp_nav_menu() in one location.
    	 */
    	register_nav_menus( array(
    		'primary' => __( 'Primary Menu', 'untitled' ),
    	) );
    
    	/**
    	 * Enable support for Post Formats
    	 */
    	add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );
    }

    Let us know if you have any problems with it. Cheers!

    Thread Starter sunilwilliams

    (@sunilwilliams)

    I’m so used to over-riding templates in child themes that it slipped my mind that I can also override functions.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Untitled prevents post-thumbnail support from loading for Custom Post Types’ is closed to new replies.