<h1 class="post-heading"><?php the_title();?></h1>
<h2 class="post-type">Страницы</h2>
<ul class="page-list">
<?php $options = get_option('blog_theme_options');$exclude=$options["exclude_post"]; ?>
<?php
$args = array(
'depth' => 0
,'show_date' => ''
,'date_format' => get_option('date_format')
,'child_of' => 0
,'exclude' => $exclude
,'exclude_tree' => ''
,'include' => ''
,'title_li' => ''
,'echo' => 1
,'authors' => ''
,'sort_column' => 'menu_order, post_title'
,'sort_order' => 'ASC'
,'link_before' => ''
,'link_after' => ''
,'meta_key' => ''
,'meta_value' => ''
,'number' => ''
,'offset' => ''
,'walker' => ''
);
wp_list_pages( $args );
?>
</li>
</ul>
<h2 class="post-type">Записи</h2>
<?php
$options = get_option('blog_theme_options');
$excludeRubric=$options["exclude_rubric"];
$allcats = get_categories('exclude='.$excludeRubric);
foreach ($allcats as $cat) :
$args = array(
'category__in' => array($cat->term_id)
);
$customInCatQuery = new WP_Query($args);
if ($customInCatQuery->have_posts()) :
echo ' <div class="posts-wrapper">
<div class="post-type__name">
<i class="fa fa-angle-up"></i> Рубрика:
</div>
<ul class="accordeon-posts">
<li class="accordeon-posts__title post-type__heading">';
echo ' <a href="#">'.$cat->name.'</a>';
echo ' </li> <ul class="list-categories">';
while ($customInCatQuery->have_posts()) : $customInCatQuery->the_post(); ?>
<li class="list-categories__item">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php
endwhile;
echo '</ul>
</ul>
</div>';
?>
<?php
else :
echo 'Нет постов в категории:'.$cat->name;
endif;
wp_reset_query();
endforeach;
?>