Hallo,
ich habe ein Problem, das mich gerade an den rand der verzweiflung bringt:
ich habe einen CPT "angebote":
//Custom Post Type: Angebote
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'angebote',
array(
'labels' => array(
'name' => __( 'Angebote' ),
'singular_name' => __( 'Angebot' ),
'all_items' => __( 'Alle zeigen' ),
'add_new' => __( 'Angebot erstellen' ),
'add_new_item' => __( 'Neues Angebot erstellen' )
),
'public' => true,
'has_archive' => true,
'show_ui' => true,
'exclude_from_search' => true,
'menu_position' => 3,
'supports' => array(
'title',
'editor',
'thumbnail',
/*'custom-fields'*/
),
'query_var' => "angebote",
)
);
}
Alles anzeigen
mit einer eigenen taxonomy "angkat":
//Custom Taxonomie: Angebotskategorie
add_action( 'init', 'build_cat' );
function build_cat() {
register_taxonomy(
'angkat',
'angebote',
array(
'hierarchical' => true,
'labels' => array(
'name' => 'Angebotstypen',
'singular_name' => 'Angebotstyp',
'all_items' => 'Alle Typen',
'add_new_item' => 'Neuen Angebotstyp hinzufügen'
),
'show_ui' => true,
'public' => true,
'rewrite' => array('slug' => 'angebotstyp'),
'show_in_nav_menus' => true,
'show_admin_column' => true,
'query_var' => true
)
);
}
Alles anzeigen
Nun habe ich einige Dummies erstellt im CPT und verschiedenen Kategorien aus "angkat" zugewiesen. Wenn ich die Kategorien im Frontend per
ausgebe, funktioniert das auch wunderbar.
Das Problem: Wenn ich nun in die Kategorie ansicht wechsle und mir alle Posts aus der entsprechenden Cat anzeigen lassen will, erhalte ich immer einen 404-Fehler.
Ich habe dafür ein eigenes Template "taxonomy-angkat.php" welches in diesem Fall auch greift, jedoch sich weigert alle Posts auszugeben.
Habe schon stundenlang im Web gesucht, wo viele Workarounds immer auf einen Hardflush der Permalinks hinausliefen. Das hat leider nicht funktioniert. Auch habe ich das Template schon auf mehreren Servern getestet - ohne Erfolg.
Hat jemand vielleicht noch eine Idee an was das liegen könnte?
Danke schonmal für euere Hilfe.
LG
PS:
Wenn ich zum debuggen auf der taxonomy-angkat.php noch $wp_query mit ausgeben lasse bekomme ich folgenden return:
WP_Query Object
(
[query_vars] => Array
(
[angkat] => mountainbikes
[error] =>
[m] => 0
[p] => 0
[post_parent] =>
[subpost] =>
[subpost_id] =>
[attachment] =>
[attachment_id] => 0
[name] =>
[static] =>
[pagename] =>
[page_id] => 0
[second] =>
[minute] =>
[hour] =>
[day] => 0
[monthnum] => 0
[year] => 0
[w] => 0
[category_name] =>
[tag] =>
[cat] =>
[tag_id] =>
[author_name] =>
[feed] =>
[tb] =>
[paged] => 0
[comments_popup] =>
[meta_key] =>
[meta_value] =>
[preview] =>
[s] =>
[sentence] =>
[fields] =>
[menu_order] =>
[category__in] => Array
(
)
[category__not_in] => Array
(
)
[category__and] => Array
(
)
[post__in] => Array
(
)
[post__not_in] => Array
(
)
[tag__in] => Array
(
)
[tag__not_in] => Array
(
)
[tag__and] => Array
(
)
[tag_slug__in] => Array
(
)
[tag_slug__and] => Array
(
)
[post_parent__in] => Array
(
)
[post_parent__not_in] => Array
(
)
[ignore_sticky_posts] =>
[suppress_filters] =>
[cache_results] => 1
[update_post_term_cache] => 1
[update_post_meta_cache] => 1
[post_type] =>
[posts_per_page] => 10
[nopaging] =>
[comments_per_page] => 50
[no_found_rows] =>
[taxonomy] => angkat
[term] => mountainbikes
[order] => DESC
)
[tax_query] => WP_Tax_Query Object
(
[queries] => Array
(
[0] => Array
(
[taxonomy] => angkat
[terms] => Array
(
[0] => mountainbikes
)
[include_children] => 1
[field] => slug
[operator] => IN
)
)
[relation] => AND
)
[meta_query] => WP_Meta_Query Object
(
[queries] => Array
(
)
[relation] =>
)
[post_count] => 0
[current_post] => -1
[in_the_loop] =>
[comment_count] => 0
[current_comment] => -1
[found_posts] => 0
[max_num_pages] => 0
[max_num_comment_pages] => 0
[is_single] =>
[is_preview] =>
[is_page] =>
[is_archive] => 1
[is_date] =>
[is_year] =>
[is_month] =>
[is_day] =>
[is_time] =>
[is_author] =>
[is_category] =>
[is_tag] =>
[is_tax] => 1
[is_search] =>
[is_feed] =>
[is_comment_feed] =>
[is_trackback] =>
[is_home] =>
[is_404] =>
[is_comments_popup] =>
[is_paged] =>
[is_admin] =>
[is_attachment] =>
[is_singular] =>
[is_robots] =>
[is_posts_page] =>
[is_post_type_archive] =>
[query_vars_hash] => 6e7061c1b41e415264b5c1114c988350
[query_vars_changed] =>
[thumbnails_cached] =>
[query] => Array
(
[angkat] => mountainbikes
)
[request] => SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (3) ) AND wp_posts.post_type IN ('post', 'page', 'attachment') AND (wp_posts.post_status = 'publish' OR wp_posts.post_author = 1 AND wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10
[posts] => Array
(
)
[queried_object] => stdClass Object
(
[term_id] => 3
[name] => Mountainbikes
[slug] => mountainbikes
[term_group] => 0
[term_taxonomy_id] => 3
[taxonomy] => angkat
[description] =>
[parent] => 0
[count] => 2
)
[queried_object_id] => 3
)
Alles anzeigen