-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaxonomy-department.php
70 lines (63 loc) · 3.44 KB
/
taxonomy-department.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
<?
defined('ABSPATH') OR exit;
/**
* @package WordPress
* @subpackage WP-Skeleton
*/
get_header();
get_template_part( 'sub-header', 'index' ); //the header stuffs
get_template_part( 'menu', 'index' ); //the menu + logo/site title
?>
<div class="super-container interior-page">
<div class="container">
<div class="sixteen columns alpha">
<div id="primary" class="full-width">
<div id="content">
<div class="two-thirds column alpha omega">
<main id="main-content" class="main">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> role="article">
<?php
$queried_object = get_queried_object();
$term_name = $queried_object->taxonomy;
$term_id = $queried_object->term_id;
?>
<header class="entry-header">
<h1 class="entry-title"><?php echo $queried_object->name;?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<?php
echo term_description($term_id, $term_name);
$class_args = array(
'post_type' => 'class',
'tax_query' => array(
array(
'taxonomy' => $term_name,
'field' => 'term_id',
'terms' => $term_id
)
)
);
$class_loop = new WP_Query( $class_args );
//var_viewer($class_loop);
if($class_loop->have_posts()) {
echo '<hr />';
echo '<h2>Related Classes</h2>';
echo '<ul>';
while ($class_loop->have_posts()) : $class_loop->the_post();
echo '<li><a href="'.get_permalink().'">'.get_the_title().'</a></li>';
endwhile;
echo '</ul>';
}
wp_reset_postdata();
?>
</div><!-- .entry-content -->
</article><!-- #post-<?php the_ID(); ?> -->
</main><!-- #main -->
</div>
<? get_sidebar('academics'); ?>
</div><!-- #content -->
</div><!-- #primary -->
</div>
</div>
</div>
<?php get_footer(); ?>