-
Notifications
You must be signed in to change notification settings - Fork 0
/
tag.php
33 lines (30 loc) · 1.26 KB
/
tag.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
global $wp_query;
$posts_per_page = $wp_query->query_vars['posts_per_page'];
$found_posts = $wp_query->found_posts;
?>
<?php get_header(); ?>
<section>
<div class="row">
<div class="column xs-span12<?php echo (is_active_sidebar('main-sidebar') ? ' lg-span8' : ''); ?>">
<div class="column-inner">
<?php if (have_posts()) : ?>
<h2>Tag: <?php single_tag_title(); ?></h2>
<h4><?php echo $found_posts ?> post<?php if ($found_posts != 1) echo 's'; ?> tagged as "<?php echo single_tag_title(); ?>"</h4>
<?php
while (have_posts()) {
the_post();
get_template_part('theme/loops/loop');
}
if ($found_posts > $posts_per_page) get_template_part('theme/partials/pagination');
?>
<?php else : ?>
<h1>No results</h1>
<p>Sorry, no posts categorized as: "<?php echo single_tag_title(); ?>".</p>
<?php endif; ?>
</div>
</div>
<?php if (is_active_sidebar('main-sidebar')) get_sidebar(); ?>
</div>
</section>
<?php get_footer(); ?>