Unyson icon indicating copy to clipboard operation
Unyson copied to clipboard

problem in showing thumbnail box of registered CPT in admin area

Open ghost opened this issue 12 years ago • 5 comments

Hi i am registering a CPT in the post.php file that existis in framework-customization folder using this piece of code

register_post_type( 'vedios',   
        array( 'labels' => array(
            'name' => __( 'الفيديوهات', 'somename' ),
            'add_new_item' => __('أضف فيديو جديد','somename'), 
            ), /* end of arrays */
            'public' => true,
            'publicly_queryable' => true,
            'exclude_from_search' => false,
            'show_ui' => true,
            'query_var' => true,
            'menu_position' => 5,
            'rewrite'   => array( 'slug' => 'vedios', 'with_front' => false ),
            'has_archive' => 'vedios',
            'capability_type' => 'post',
            'hierarchical' => false,
            /* the next one is important, it tells what's enabled in the post editor */
            'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments',)
        ) /* end of options */
    ); /* end of register post type */

please consider that i add thumbnail in the supports array the problem is the featured image box isn't shown somename

ghost avatar Nov 05 '14 19:11 ghost

Hi, In other post types the featured image is working?

ghost avatar Nov 05 '14 20:11 ghost

the featured image box is working only in Blog posts and it works with all of other post types when i use the piece of code that you are using in the portfolio extension

add_action( 'do_meta_boxes', array( $this, '_action_admin_featured_image_label' ) );
/**
 * Change the title of Featured Image Meta box
 * @internal
 */
public function _action_admin_featured_image_label() {
    remove_meta_box( 'postimagediv', $this->post_type, 'side' );
    add_meta_box( 'postimagediv', __( 'Project Cover Image', 'fw' ),        'post_thumbnail_meta_box', $this->post_type, 'side' );
}

but it's not working with every post type i register in the posts.php file

ghost avatar Nov 06 '14 07:11 ghost

I added register_post_type() in my framework-customizations/theme/posts.php and it works.

Please try with the Unyson scratch theme, if it will work then it's something wrong with your theme.

ghost avatar Nov 06 '14 09:11 ghost

thanks for your quick response i'm using Unyson scratch them already, i'll try to debug this .......... thanks again

ghost avatar Nov 06 '14 13:11 ghost

Hi @mohammed-manssour, I have got exactly the same issue. Did you find the way to fix it? Thank you for your help.

Alex-Ascet avatar Sep 21 '15 01:09 Alex-Ascet