Вывод всех статей по категориям на одной странице.
Выводим статьи с разбивкой по категориям в WordPress, используя сниппет, который нужно вставить в нужный файл вашей темы.
<?php
//for each category, show all posts
$cat_args=array(
'orderby' => 'name',
'order' => 'ASC'
);
$categories=get_categories($cat_args);
foreach($categories as $category) {
$args=array(
'showposts' => -1,
'category__in' => array($category->term_id),
'caller_get_posts'=>1
);
$posts=get_posts($args);
if ($posts) {
echo '<h2>' . $category->name.'</h2>';
foreach($posts as $post) {
setup_postdata($post); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
} // foreach($posts
} // if ($posts
} // foreach($categories
?>