-
Notifications
You must be signed in to change notification settings - Fork 0
/
taxonomy-twu-portfolio-tag.php
executable file
·87 lines (51 loc) · 1.9 KB
/
taxonomy-twu-portfolio-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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php get_header(); ?>
<div class="content">
<div class="page-title">
<div class="section-inner">
<h4><?php
// the term we need for this taxonomy
$term_obj = get_queried_object();
// get the term object
$term = get_term( $term_obj->term_id, 'twu-portfolio-tag' );
// get a count of content with this term
$tax_count = twu_portfolio_tax_count('twu-portfolio-tag', $term->slug);
$plural = ( $tax_count == 1) ? '' : 's';
echo $tax_count . ' Artifact' . $plural . ' Tagged "' . $term->name . '"';
?>
</h4>
<?php
// Show an optional term description.
$term_description = term_description();
if ( ! empty( $term_description ) ) :
printf( '<div class="taxonomy-description">%s</div>', $term_description );
endif;
?>
<?php
$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
if ( 1 < $wp_query->max_num_pages ) : ?>
<span><?php printf( __( 'Page %s of %s', 'fukasawa' ), $paged, $wp_query->max_num_pages ); ?></span>
<div class="clear"></div>
<?php endif; ?>
</h4>
</div><!-- .section-inner -->
</div><!-- .page-title -->
<?php if ( have_posts() ) : ?>
<div class="posts" id="posts">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'content', 'twu-portfolio' );
endwhile;
?>
</div><!-- .posts -->
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<div class="archive-nav">
<div class="section-inner">
<?php echo get_next_posts_link( '« ' . __( 'Older artifacts', 'fukasawa' ) ); ?>
<?php echo get_previous_posts_link( __( 'Newer artifacts', 'fukasawa' ) . ' »' ); ?>
<div class="clear"></div>
</div>
</div><!-- .post-nav archive-nav -->
<?php endif; ?>
<?php endif; ?>
</div><!-- .content -->
<?php get_footer(); ?>