Guten Tag liebe Community,
Ich habe mir mit register_post_type einen neuen post_type registriert, der heißt `project`. Zur eigenen Individualisierung meiner WordPress Installation habe ich dazu auch im Backend ein Menü erstellt, welches daruf verweist, siehe Bild. [attach='10504.vB'][/attach]
An sich funktioniert auch alles, so wie ich es mir vorstelle, doch was nicht funktioniert ist, das ich ein Beitragsbild festlegen kann. Hier dazu mal mein Code:
add_action('admin_menu', 'projects');
if (!function_exists( 'projects' )) {
function projects() {
// Register Post Type
register_post_type('project', array(
'labels' => array(
'name' => 'Projekte',
'singular_name' => 'Projekt',
'menu_name' => 'Alle Projekte',
'name_admin_bar' => 'Projekt',
'add_new' => 'Neues Projekt Erstellen',
'add_new_item' => 'Erstelle Neues Projekt',
'new_item' => 'Neues Projekt erstellen',
'edit_item' => 'Projekt bearbeiten',
'view_item' => 'Projekt ansehen',
'all_items' => 'Alle Projekte',
'search_items' => 'Suche nach Projekten',
'parent_item_colon' => 'Übergeordnete Projekte:',
'not_found' => 'Keine Projekte gefunden.',
'not_found_in_trash' => 'Keine Projekte im Papierkorb gefunden.'
),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array(
'slug' => 'project'
),
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array(
'title',
'editor',
'author',
'thumbnail',
'excerpt'
)));
// Add Parent Menue
add_menu_page('Alle Projekte', 'Projekte', 'manage_options', 'edit.php?post_type=project', '', 'dashicons-clipboard', 8);
// Add Child Menue
add_submenu_page('edit.php?post_type=project', 'Projekte', 'Alle Projekte', 'manage_options', 'edit.php?post_type=project' );
add_submenu_page('edit.php?post_type=project', 'Neues Projekt', 'Projekt Erstellen', 'manage_options', 'post-new.php?post_type=project' );
if ( current_theme_supports( 'post-thumbnails' ) ) {
if ( remove_theme_support( 'post-thumbnails' ) ) {
add_theme_support( 'post-thumbnails', array( 'post', 'project' ) );
}
}
}
}
Alles anzeigen
Ich verwende das Theme twenty Fourteen und habe deshalb auch die if Abfrage ganz unten im Code hinzugefügt, aber es funktioniert weiterhin nicht ![]()
Könnt ihr mir helfen? Ich werde so langsam echt ratlos, was das angeht und bedanke mich schon einmal im voraus für jede Hilfe! :$
Sonnige Grüße,
Htaccess