Support » Plugin: Custom Post Type UI » Feature image is not showing

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Are you talking about the option to select a featured image when editing a post? or on the frontend when viewing the published post?

    Thread Starter sureshsuthar

    (@sureshsuthar)

    Yes I am talking about featured image when editing a post or page in wp bakend (Not showing option to add or remove feature image on right side )

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hmm…

    Have you checked the screen options tab up at the top, if you’re not seeing the Gutenberg-based editor screen? It may not be toggled to show.

    If you are using Gutenberg, there should be an options section under the 3 vertical dots to toggle different features as well.

    Thread Starter sureshsuthar

    (@sureshsuthar)

    I am using Gutenberg.
    check here: https://nimb.ws/EuFM8b

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    That’s…a new one to me because by all indications you SHOULD have the panel. I have to believe something with your editor screen is having an effect on things, maybe some sort of js error, perhaps something with some custom css added that is visually hiding the spot? Beyond that, I really don’t know what to suggest here

    Thread Starter sureshsuthar

    (@sureshsuthar)

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    out of curiosity, did you edit the “capability type” field away from “post” for your CPTs in question? If yes, can you try setting it back to “post” and see if things resolve?

    Thread Starter sureshsuthar

    (@sureshsuthar)

    No I did not change it, it’s default post

    function cptui_register_my_cpts() {
    
    	/**
    	 * Post Type: Events.
    	 */
    
    	$labels = array(
    		"name" => __( "Events", "custom-post-type-ui" ),
    		"singular_name" => __( "Event", "custom-post-type-ui" ),
    	);
    
    	$args = array(
    		"label" => __( "Events", "custom-post-type-ui" ),
    		"labels" => $labels,
    		"description" => "",
    		"public" => true,
    		"publicly_queryable" => true,
    		"show_ui" => true,
    		"delete_with_user" => false,
    		"show_in_rest" => true,
    		"rest_base" => "",
    		"rest_controller_class" => "WP_REST_Posts_Controller",
    		"has_archive" => false,
    		"show_in_menu" => true,
    		"show_in_nav_menus" => true,
    		"exclude_from_search" => false,
    		"capability_type" => "post",
    		"map_meta_cap" => true,
    		"hierarchical" => false,
    		"rewrite" => array( "slug" => "event", "with_front" => true ),
    		"query_var" => true,
    		"menu_icon" => "dashicons-calendar",
    		"supports" => array( "title", "editor", "excerpt" ),
    	);
    
    	register_post_type( "event", $args );
    
    	/**
    	 * Post Type: Themes.
    	 */
    
    	$labels = array(
    		"name" => __( "Themes", "custom-post-type-ui" ),
    		"singular_name" => __( "Theme", "custom-post-type-ui" ),
    	);
    
    	$args = array(
    		"label" => __( "Themes", "custom-post-type-ui" ),
    		"labels" => $labels,
    		"description" => "",
    		"public" => true,
    		"publicly_queryable" => true,
    		"show_ui" => true,
    		"delete_with_user" => false,
    		"show_in_rest" => true,
    		"rest_base" => "",
    		"rest_controller_class" => "WP_REST_Posts_Controller",
    		"has_archive" => false,
    		"show_in_menu" => true,
    		"show_in_nav_menus" => true,
    		"exclude_from_search" => false,
    		"capability_type" => "post",
    		"map_meta_cap" => true,
    		"hierarchical" => false,
    		"rewrite" => array( "slug" => "themes", "with_front" => true ),
    		"query_var" => true,
    		"menu_icon" => "dashicons-art",
    		"supports" => array( "title", "editor", "excerpt" ),
    	);
    
    	register_post_type( "themes", $args );
    
    	/**
    	 * Post Type: Entertainments.
    	 */
    
    	$labels = array(
    		"name" => __( "Entertainments", "custom-post-type-ui" ),
    		"singular_name" => __( "Entertainment", "custom-post-type-ui" ),
    	);
    
    	$args = array(
    		"label" => __( "Entertainments", "custom-post-type-ui" ),
    		"labels" => $labels,
    		"description" => "",
    		"public" => true,
    		"publicly_queryable" => true,
    		"show_ui" => true,
    		"delete_with_user" => false,
    		"show_in_rest" => true,
    		"rest_base" => "",
    		"rest_controller_class" => "WP_REST_Posts_Controller",
    		"has_archive" => false,
    		"show_in_menu" => true,
    		"show_in_nav_menus" => true,
    		"exclude_from_search" => false,
    		"capability_type" => "post",
    		"map_meta_cap" => true,
    		"hierarchical" => false,
    		"rewrite" => array( "slug" => "entertainments", "with_front" => true ),
    		"query_var" => true,
    		"menu_icon" => "dashicons-smiley",
    		"supports" => array( "title", "editor" ),
    	);
    
    	register_post_type( "entertainments", $args );
    
    	/**
    	 * Post Type: Testimonials.
    	 */
    
    	$labels = array(
    		"name" => __( "Testimonials", "custom-post-type-ui" ),
    		"singular_name" => __( "Testimonial", "custom-post-type-ui" ),
    	);
    
    	$args = array(
    		"label" => __( "Testimonials", "custom-post-type-ui" ),
    		"labels" => $labels,
    		"description" => "",
    		"public" => true,
    		"publicly_queryable" => true,
    		"show_ui" => true,
    		"delete_with_user" => false,
    		"show_in_rest" => true,
    		"rest_base" => "",
    		"rest_controller_class" => "WP_REST_Posts_Controller",
    		"has_archive" => false,
    		"show_in_menu" => true,
    		"show_in_nav_menus" => true,
    		"exclude_from_search" => false,
    		"capability_type" => "post",
    		"map_meta_cap" => true,
    		"hierarchical" => false,
    		"rewrite" => array( "slug" => "testimonial", "with_front" => true ),
    		"query_var" => true,
    		"menu_icon" => "dashicons-format-quote",
    		"supports" => array( "title", "editor", "excerpt" ),
    	);
    
    	register_post_type( "testimonial", $args );
    
    	/**
    	 * Post Type: Past events.
    	 */
    
    	$labels = array(
    		"name" => __( "Past events", "custom-post-type-ui" ),
    		"singular_name" => __( "past event", "custom-post-type-ui" ),
    	);
    
    	$args = array(
    		"label" => __( "Past events", "custom-post-type-ui" ),
    		"labels" => $labels,
    		"description" => "",
    		"public" => true,
    		"publicly_queryable" => true,
    		"show_ui" => true,
    		"delete_with_user" => false,
    		"show_in_rest" => true,
    		"rest_base" => "",
    		"rest_controller_class" => "WP_REST_Posts_Controller",
    		"has_archive" => false,
    		"show_in_menu" => true,
    		"show_in_nav_menus" => true,
    		"exclude_from_search" => false,
    		"capability_type" => "post",
    		"map_meta_cap" => true,
    		"hierarchical" => false,
    		"rewrite" => array( "slug" => "past_event", "with_front" => true ),
    		"query_var" => true,
    		"menu_icon" => "dashicons-image-rotate",
    		"supports" => array( "title", "editor" ),
    	);
    
    	register_post_type( "past_event", $args );
    }
    
    add_action( 'init', 'cptui_register_my_cpts' );

    Below is taxonomy code

    function cptui_register_my_taxes() {
    
    	/**
    	 * Taxonomy: Event types.
    	 */
    
    	$labels = array(
    		"name" => __( "Event types", "custom-post-type-ui" ),
    		"singular_name" => __( "Event type", "custom-post-type-ui" ),
    	);
    
    	$args = array(
    		"label" => __( "Event types", "custom-post-type-ui" ),
    		"labels" => $labels,
    		"public" => true,
    		"publicly_queryable" => true,
    		"hierarchical" => true,
    		"show_ui" => true,
    		"show_in_menu" => true,
    		"show_in_nav_menus" => true,
    		"query_var" => true,
    		"rewrite" => array( 'slug' => 'event-type', 'with_front' => true, ),
    		"show_admin_column" => false,
    		"show_in_rest" => true,
    		"rest_base" => "event_type",
    		"rest_controller_class" => "WP_REST_Terms_Controller",
    		"show_in_quick_edit" => false,
    		);
    	register_taxonomy( "event_type", array( "event" ), $args );
    
    	/**
    	 * Taxonomy: Theme types.
    	 */
    
    	$labels = array(
    		"name" => __( "Theme types", "custom-post-type-ui" ),
    		"singular_name" => __( "Theme type", "custom-post-type-ui" ),
    	);
    
    	$args = array(
    		"label" => __( "Theme types", "custom-post-type-ui" ),
    		"labels" => $labels,
    		"public" => true,
    		"publicly_queryable" => true,
    		"hierarchical" => false,
    		"show_ui" => true,
    		"show_in_menu" => true,
    		"show_in_nav_menus" => true,
    		"query_var" => true,
    		"rewrite" => array( 'slug' => 'theme-type', 'with_front' => true, ),
    		"show_admin_column" => false,
    		"show_in_rest" => true,
    		"rest_base" => "theme_type",
    		"rest_controller_class" => "WP_REST_Terms_Controller",
    		"show_in_quick_edit" => false,
    		);
    	register_taxonomy( "theme_type", array( "themes" ), $args );
    }
    add_action( 'init', 'cptui_register_my_taxes' );
    

    DEBUG INFORMATION

    			
    		### Begin Custom Post Type UI Debug Info ###
    
    		Multisite:                No
    
    		SITE_URL:                 https://applause.saltandfuessel.com.au
    		HOME_URL:                 https://applause.saltandfuessel.com.au
    
    		WordPress Version:        5.1.1
    		Permalink Structure:      /%postname%/
    		Active Theme:             Saltandfuessel Child 1.0.0
    
    		Registered Post Types:    post, page, attachment, revision, nav_menu_item, custom_css, customize_changeset, oembed_cache, user_request, wp_block, acf-field-group, acf-field, acf_option_page, wpcf7_contact_form, event, themes, entertainments, testimonial, past_event
    
    		PHP Version:              7.0.32
    		MySQL Version:            5.5.5
    		Web Server Info:          Apache/2.4.34 (Amazon) OpenSSL/1.0.2k-fips
    
    		Show On Front:            page
    		Page On Front:            Home (#82)
    		Page For Posts:           Blog (#385)
    
    		WordPress Memory Limit:   40MB
    
    		TOTAL PLUGINS: 11
    
    		ACTIVE PLUGINS: (11)
    
    		ACF Option Pages: 1.1.0
    		Advanced Custom Fields PRO: 5.7.6
    		Akismet Anti-Spam: 4.1.1
    		Contact Form 7: 5.1.1
    		Contact Form 7 Honeypot: 1.14
    		Custom Post Type UI: 1.6.1
    		Duplicate Post: 3.2.2
    		Safe SVG: 1.9.4
    		Wordfence Security: 7.2.5
    		WP All Export: 1.2.3
    		Yoast SEO: 11.0
    
    		INACTIVE PLUGINS: (0)
    
    		Post Types: 
    		{"event":{"name":"event","label":"Events","singular_label":"Event","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"false","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"dashicons-calendar","supports":["title","editor","excerpt"],"taxonomies":[],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":""},"custom_supports":""},"themes":{"name":"themes","label":"Themes","singular_label":"Theme","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"false","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"dashicons-art","supports":["title","editor","excerpt"],"taxonomies":[],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":""},"custom_supports":""},"entertainments":{"name":"entertainments","label":"Entertainments","singular_label":"Entertainment","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"false","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"dashicons-smiley","supports":["title","editor"],"taxonomies":[],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":""},"custom_supports":""},"testimonial":{"name":"testimonial","label":"Testimonials","singular_label":"Testimonial","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"false","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"dashicons-format-quote","supports":["title","editor","excerpt"],"taxonomies":[],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":""},"custom_supports":""},"past_event":{"name":"past_event","label":"Past events","singular_label":"past event","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"false","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"dashicons-image-rotate","supports":["title","editor"],"taxonomies":[],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":""},"custom_supports":""}}
    
    		Taxonomies: 
    		{"event_type":{"name":"event_type","label":"Event types","singular_label":"Event type","description":"","public":"true","publicly_queryable":"true","hierarchical":"true","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"true","query_var":"true","query_var_slug":"","rewrite":"true","rewrite_slug":"event-type","rewrite_withfront":"1","rewrite_hierarchical":"0","show_admin_column":"false","show_in_rest":"true","show_in_quick_edit":"","rest_base":"","rest_controller_class":"","labels":{"menu_name":"","all_items":"","edit_item":"","view_item":"","update_item":"","add_new_item":"","new_item_name":"","parent_item":"","parent_item_colon":"","search_items":"","popular_items":"","separate_items_with_commas":"","add_or_remove_items":"","choose_from_most_used":"","not_found":"","no_terms":"","items_list_navigation":"","items_list":""},"meta_box_cb":"","object_types":["event"]},"theme_type":{"name":"theme_type","label":"Theme types","singular_label":"Theme type","description":"","public":"true","publicly_queryable":"true","hierarchical":"false","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"true","query_var":"true","query_var_slug":"","rewrite":"true","rewrite_slug":"theme-type","rewrite_withfront":"1","rewrite_hierarchical":"0","show_admin_column":"false","show_in_rest":"true","show_in_quick_edit":"","rest_base":"","rest_controller_class":"","labels":{"menu_name":"","all_items":"","edit_item":"","view_item":"","update_item":"","add_new_item":"","new_item_name":"","parent_item":"","parent_item_colon":"","search_items":"","popular_items":"","separate_items_with_commas":"","add_or_remove_items":"","choose_from_most_used":"","not_found":"","no_terms":"","items_list_navigation":"","items_list":""},"meta_box_cb":"","object_types":["themes"]}}
    
    		### End Debug Info ###
    				

    Also I tested like copy above taxonomy and post type code and put in function file, then after I removed this plugin , Still getting same issue. I think it’s issue on wordpress, If I am right can you please report on WordPress.

    • This reply was modified 2 years, 4 months ago by sureshsuthar.
    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Something odd is most definitely going on, at least with your post types because I am able to recreate with your provided settings data. However, I haven’t managed to track down what exactly, and if CPTUI’s core code is playing any part as well.

    As helper tests, I have 1 CPT being registered away from CPTUI, and then 1 very basic CPT registered WITH CPTUI and both are showing the option to add a featured image.

    One things I want to point out is that all your post types don’t have the “featured image” checkbox checked, in case that’s playing some level of a part here. I did check/save those, and it’s still not working on my end, which doesn’t help my frustration 😀

    I need some more time with this to see if I can track down the exact details, as it is making me scratch my head rather well.

    Thread Starter sureshsuthar

    (@sureshsuthar)

    Thanks for work on detail. And take your time.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Just in case, any changes on your end? Gonna try to see if I can figure this out more today yet.

    Thread Starter sureshsuthar

    (@sureshsuthar)

    I didn’t to do any changes after I sent code to you.

    • This reply was modified 2 years, 4 months ago by sureshsuthar.
    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Took me awhile, but I believe the issue is coming down to the “themes” post type slug you have.

    Technically “theme” is a reserved post type slug that should be avoided, as per https://codex.wordpress.org/Function_Reference/register_post_type#Reserved_Post_Types but it’s appearing like “themes” should be avoided as well.

    Once I changed the slug to even just “themesx”, suddenly featured image UI showed up for all of the 5 you have going.

    While not a common post type from what I’ve experienced over the years, I will probably add “themes” to our list of reserved post types and prevent creating new ones using it. This wouldn’t prevent your install from still using it, but that’s a different topic that should still be addressed.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Thread Starter sureshsuthar

    (@sureshsuthar)

    Thank you so much now it’s working after change ‘themes’ post type slug.
    Also thank you for below this, this will help to user

    , I will probably add “themes” to our list of reserved post types and prevent creating new ones using it.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Feature image is not showing’ is closed to new replies.