Das ausgewählte Bild im benutzerdefinierten Beitrag wird deaktiviert

Ich versuche, einen benutzerdefinierten Beitrag als Plugin zu erstellen, und bisher habe ich Probleme, das vorgestellte Bild auf meinem benutzerdefinierten Beitragstyp zu aktivieren. Im Moment habe ich zwei benutzerdefinierte Post-Typen erstellt, aber das Problem ist, dass, wenn ich versuchte, beide zu aktivieren, das andere benutzerdefinierte Post-Typ-Feature-Bild deaktiviert wird. Bisher kann ich die Ursache nicht identifizieren und habe auch versucht, auf google nach Antworten zu suchen

Hier ist der Code, an dem ich gearbeitet habe.

1. Benutzerdefinierte Beitragstyp (Folien)

  _x( 'Slides', 'Post Type General Name', 'twentythirteen' ), 'singular_name' => _x( 'Slides', 'Post Type Singular Name', 'twentythirteen' ), 'menu_name' => __( 'Slides', 'twentythirteen' ), 'parent_item_colon' => __( 'Parent Slides', 'twentythirteen' ), 'all_items' => __( 'All Slides', 'twentythirteen' ), 'view_item' => __( 'View Slide', 'twentythirteen' ), 'add_new_item' => __( 'Add New Slide', 'twentythirteen' ), 'add_new' => __( 'Add Slide', 'twentythirteen' ), 'edit_item' => __( 'Edit Slide', 'twentythirteen' ), 'update_item' => __( 'Update Slide', 'twentythirteen' ), 'search_items' => __( 'Search Slide', 'twentythirteen' ), 'not_found' => __( 'Not Found', 'twentythirteen' ), 'not_found_in_trash' => __( 'Not found in Trash', 'twentythirteen' ), ); // Set other options for Custom Post Type $args = array( 'label' => __( 'Slide', 'twentythirteen' ), 'description' => __( 'Slide', 'twentythirteen' ), 'labels' => $labels, // Features this CPT supports in Post Editor 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), // You can associate this CPT with a taxonomy or custom taxonomy. 'taxonomies' => array('category', 'post_tag'), /* A hierarchical CPT is like Pages and can have * Parent and child items. A non-hierarchical CPT * is like Posts. */ 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 4, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'page', ); // Registering your Custom Post Type register_post_type( 'slides', $args ); } /* Hook into the 'init' action so that the function * Containing our post type registration is not * unnecessarily executed. */ add_action( 'init', 'slides', 1 ); /* Enable Featured Image */ add_action( 'after_setup_theme', 'slides_featured_image'); function slides_featured_image() { add_theme_support( 'post-thumbnails', array( 'post', 'page', 'slides' ) ); } ?> 

2. Benutzerdefinierte Beitragstyp (Artikel)

   _x( 'News & Press Release', 'Post Type General Name', 'twentythirteen' ), 'singular_name' => _x( 'News & Press Release', 'Post Type Singular Name', 'twentythirteen' ), 'menu_name' => __( 'News & Press', 'twentythirteen' ), 'parent_item_colon' => __( 'Parent News & Press Release', 'twentythirteen' ), 'all_items' => __( 'All Articles', 'twentythirteen' ), 'view_item' => __( 'View Article', 'twentythirteen' ), 'add_new_item' => __( 'Add New Article', 'twentythirteen' ), 'add_new' => __( 'Add Article', 'twentythirteen' ), 'edit_item' => __( 'Edit Article', 'twentythirteen' ), 'update_item' => __( 'Update Article', 'twentythirteen' ), 'search_items' => __( 'Search Article', 'twentythirteen' ), 'not_found' => __( 'Not Found', 'twentythirteen' ), 'not_found_in_trash' => __( 'Not found in Trash', 'twentythirteen' ), ); // Set other options for Custom Post Type $args = array( 'label' => __( 'News & Press Release', 'twentythirteen' ), 'description' => __( 'News & Press Release', 'twentythirteen' ), 'labels' => $labels, // Features this CPT supports in Post Editor 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), // You can associate this CPT with a taxonomy or custom taxonomy. 'taxonomies' => array('category', 'post_tag'), /* A hierarchical CPT is like Pages and can have * Parent and child items. A non-hierarchical CPT * is like Posts. */ 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 4, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'page', ); // Registering your Custom Post Type register_post_type( 'news_press', $args ); } /* Hook into the 'init' action so that the function * Containing our post type registration is not * unnecessarily executed. */ add_action( 'init', 'news_press', 1 ); /* Enable Featured Image */ add_action( 'after_setup_theme', 'news_press_featured_image'); function news_press_featured_image() { add_theme_support( 'post-thumbnails', array( 'post', 'page', 'news_press' ) ); } ?> 

Solutions Collecting From Web of "Das ausgewählte Bild im benutzerdefinierten Beitrag wird deaktiviert"