category pages
This commit is contained in:
17
category.php
17
category.php
@ -6,7 +6,22 @@
|
||||
<?php get_template_part('global-head'); ?>
|
||||
<main id="main-content" class="container" role="main">
|
||||
|
||||
<h1><?php single_cat_title(); ?></h1>
|
||||
|
||||
<?php
|
||||
$cat = array_shift(get_the_category());
|
||||
|
||||
$query = new WP_Query( array(
|
||||
'name' => $cat->slug,
|
||||
'post_type' => 'page'
|
||||
));
|
||||
|
||||
$page = array_shift($query->get_posts());
|
||||
?>
|
||||
|
||||
<section>
|
||||
<h1><?php echo ($page->post_title) ? $page->post_title : $cat->name; ?></h1>
|
||||
<?php echo apply_filters('the_content', $page->post_content); ?>
|
||||
</section>
|
||||
|
||||
<div class="grid col-100">
|
||||
<?php get_template_part('loop'); ?>
|
||||
|
Reference in New Issue
Block a user