forked from dailybruin/caeruleum
/
archive.php
executable file
·130 lines (125 loc) · 4.93 KB
/
archive.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php get_header(); ?>
<div class="row db-story">
<div class="large-8 columns db-story-post">
<div class="page-header">
<h2>
<?php
$sectionPage = false;
$mainSection = false;
$multSection = false;
$sectionTag = "";
$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
$categoryTitle = single_cat_title('',false);
if ($term) {
echo $term->name;
} elseif (is_post_type_archive()) {
echo get_queried_object()->labels->name;
} elseif (is_day()) {
printf(__('Daily Archives: %s', 'roots'), get_the_date());
} elseif (is_month()) {
printf(__('Monthly Archives: %s', 'roots'), get_the_date('F Y'));
} elseif (is_year()) {
printf(__('Yearly Archives: %s', 'roots'), get_the_date('Y'));
} elseif (is_author()) {
printf(__('Author Archives: %s', 'roots'), get_the_author());
} else {
$sectionPage = true;
switch ($categoryTitle)
{
case "Bruin Sights":
the_blog_banner('bruinsights');
break;
case "Spotlight":
the_blog_banner('spotlight');
break;
case "Timestamp":
the_blog_banner('timestamp');
break;
case "Idle Thoughts":
the_blog_banner('two-cents-idle-thoughts');
break;
case "Political Commentary":
the_blog_banner('two-cents-political-commentary');
break;
case "Social Commentary":
the_blog_banner('two-cents-social-commentary');
break;
default:
echo $categoryTitle;
}
// Separate case for sports as its name is the same as several other categories
$cat = get_category(get_query_var('cat'));
if ($cat->slug == 'sports-two-cents')
{
the_blog_banner('two-cents-sports');
}
}
?>
</h1>
<?php
if($sectionPage):
$categoryID = get_query_var('cat');
$cat_args = array(
'parent' => $categoryID,
'orderby' => 'name',
'hide_empty' => 1,
'title_li' => ''
);
$categories = get_categories($cat_args);
if(!empty($categories)): ?>
<?php if(count($categories)>8): ?>
<div class="db-sub-list-col hide-for-small">
<?php else: ?>
<div class="db-sub-list">
<?php endif; ?>
<ul>
<?php wp_list_categories($cat_args); ?>
</ul>
</div>
<?php endif;
endif; ?>
<?php if(is_author()): ?>
<p><?php the_author_meta('description'); ?></p>
<?php if(!get_the_author_meta('graduated')) : ?>
<?php if(get_the_author_meta('twitter_handle')) : ?>
<a href="https://twitter.com/<?php echo substr(get_the_author_meta('twitter_handle'),1); ?>" class="twitter-follow-button" data-show-count="false">Follow <?php the_author_meta('twitter_handle'); ?></a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<?php endif; ?>
<a class="author-email-inside" href="mailto:<?php the_author_meta('user_email'); ?>"><i class="ticon-email"></i>Email</a>
<?php endif; ?>
<?php endif; ?>
<hr>
</div><!-- end div.page-header -->
<?php get_template_part('loop', 'category'); ?>
</div><!-- end div#post-listing -->
<?php if($categoryTitle == "Two Cents"):
$two_cents_contributors = get_two_cents_contributors();
?>
<div class="large-4 columns">
<div class="row">
<h2 class='text-center hide-for-medium hide-for-small'>Meet the Columnists</h2>
<?php
$i = 0;
foreach ($two_cents_contributors as $contributor):
?>
<div class="medium-3 columns hide-for-medium hide-for-small">
<img data-tooltip class="has-tip tip-left"
title="<?php echo $contributor['name']?></br><?php echo $contributor['position']?>"
src=<?php echo $contributor['img'] ?> />
</div>
<?php $i++; endforeach ?>
<?php while($i%4!=0): ?>
<div class="medium-3 columns hide-for-medium hide-for-small">
</div>
<?php $i++; endwhile; ?>
</div>
<div class="db-divide hide-for-medium hide-for-small"></div>
<ul id="sidebar-list">
<?php dynamic_sidebar('sidebar-primary'); ?>
</ul><!-- end div#sidebar-list -->
</div>
<?php else: ?>
<?php get_template_part('sidebar'); ?>
<?php endif; ?>
</div><!-- end div#archive-content -->
<?php get_footer(); ?>