Taxonomie Arbeit ist unter dem Produkt Post Typ registrieren .. überprüfen diesen CodeRegister Taxonomie nicht fein
add_action('init', 'create_custom_taxonomies', 0);
function create_custom_taxonomies() {
$labels = array(
'name' => _x('Brands', 'taxonomy general name'),
'singular_name' => _x('Brand', 'taxonomy singular name'),
'search_items' => __('Search Brands'),
'all_items' => __('All Brands'),
'parent_item' => __('Parent Brand'),
'parent_item_colon' => __('Parent Brand:'),
'edit_item' => __('Edit Brand'),
'update_item' => __('Update Brand'),
'add_new_item' => __('Add New Brand'),
'new_item_name' => __('New Brand Name'),
'menu_name' => __('Brand'),
);
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array('slug' => 'brand'),
);
register_taxonomy('brand', 'products' , $args);
}
//creating a custom post type that is using 'brand' taxonomy
function create_post_type() {
register_post_type('products',
array(
'labels' => array(
'name' => __('Products'),
'singular_name' => __('Product'),
'add_new' => _x('Add New', 'products'),
'add_new_item' => __('Add New Product'),
'edit_item' => __('Edyt Product'),
'new_item' => __('New Product'),
'view_item' => __('View Product'),
'search_items' => __('Search Product'),
'not_found' => __('Nothing found'),
),
'taxonomies' => array('brand'),
'supports' => array('title', 'editor', 'thumbnail'),
'public' => true,
'has_archive' => true,
'show_ui' => true,
)
);
}
add_action('init', 'create_post_type');
Wenn ich alle Taxonomien drucken. es zeigt mir dieses Ergebnis .. warum dies mir passieren helfen bitte
array (size=5)
'category' => string 'category' (length=8)
'post_tag' => string 'post_tag' (length=8)
'nav_menu' => string 'nav_menu' (length=8)
'link_category' => string 'link_category' (length=13)
'post_format' => string 'post_format' (length=11)
ich mehr Mal mit Demo-Code zusätzlichen versuchen aber Ergebnis gleich ist .. nur Wordpress Standard-Taxonomien zeigen ..
Haben Sie Fehler in Ihrem PHP-Fehlerprotokoll? – Kevinvhengst
Nein, ich bekomme keinen Fehler –
Ich habe neue WordPress installiert und dann oben genannten Code in function.php hinzugefügt. aber nicht funktioniert .. –