forked from Purdue/purdue-wp-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaxonomy-dept_tax.php
48 lines (41 loc) · 1.22 KB
/
taxonomy-dept_tax.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
<?php
/**
*
* The template for displaying department archive pages.
*
* @package purdue-wp-theme
*/
?>
<?php get_header(); ?>
<?php
// get the title and description from the taxonomy term settings for current post
$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
$title = $term->name;
$description = $term->description;
// get the image from the taxonomy term settings for current post.
$tax = $term->taxonomy;
$id = $tax . '_' . $term->term_id;
$imageUrl = '';
if (function_exists('get_field')) {
$imageUrl = get_field('upload_hero_image', $id);
}
?>
<main id="site-content" role="main">
<div class="bulma-blocks-50-50-hero">
<div class="columns is-mobile is-gapless">
<div class="column is-half-desktop is-half-widescreen is-half-fullhd">
<div class="section content">
<h1><?php echo ($title); ?></h1>
<p><?php echo ($description); ?></p>
</div>
</div>
<div class="column is-half-desktop is-half-widescreen is-half-fullhd">
<span class="background-image" role="img" style="background-image:url(<?php echo ($imageUrl); ?>)" aria-label=""></span>
</div>
</div>
</div>
<?php
dynamic_sidebar('pubs-dept-page');
?>
</main><!-- #site-content -->
<?php get_footer(); ?>