$cat):
$sub_cats = get_terms([
'taxonomy' => 'wiki_category',
'hide_empty' => false,
'parent' => $cat->term_id,
'orderby' => 'menu_order',
'order' => 'ASC',
]);
$direct_articles = new WP_Query([
'post_type' => 'bluesky_wiki',
'posts_per_page' => -1,
'post_status' => 'publish',
'orderby' => 'menu_order title',
'order' => 'ASC',
'tax_query' => [[
'taxonomy' => 'wiki_category',
'field' => 'term_id',
'terms' => $cat->term_id,
'include_children' => false,
]],
]);
?>
have_posts()): ?>
Allgemein
have_posts()): $direct_articles->the_post();
$thumb = has_post_thumbnail()
? get_the_post_thumbnail_url(get_the_ID(), 'thumbnail')
: get_template_directory_uri() . '/images/logo.png';
$excerpt = get_the_excerpt() ?: wp_trim_words(get_the_content(), 15, '...');
?>
→
'bluesky_wiki',
'posts_per_page' => -1,
'post_status' => 'publish',
'orderby' => 'menu_order title',
'order' => 'ASC',
'tax_query' => [[
'taxonomy' => 'wiki_category',
'field' => 'term_id',
'terms' => $sub->term_id,
'include_children' => false,
]],
]);
if (!$sub_articles->have_posts()) { wp_reset_postdata(); continue; }
?>
name); ?>
have_posts()): $sub_articles->the_post();
$thumb = has_post_thumbnail()
? get_the_post_thumbnail_url(get_the_ID(), 'thumbnail')
: get_template_directory_uri() . '/images/logo.png';
$excerpt = get_the_excerpt() ?: wp_trim_words(get_the_content(), 15, '...');
?>
→