-
Notifications
You must be signed in to change notification settings - Fork 0
/
section-subheader.php
78 lines (70 loc) · 2.81 KB
/
section-subheader.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
<?php
if(get_query_var('cartochaco_advanced_nav')) :
?>
<h1 class="title"><?php _e('Advanced filters', 'jeo-blank'); ?></h1>
<?php
cartochaco_adv_nav_filters();
/* elseif(is_front_page() || is_tax('publisher')) : ?>*/
elseif(false) : ?>
<div class="clearfix">
<div class="choose-filter" style="padding: 20px 0 0 0;">
<?php
$publishers = get_terms('publisher');
$title = '<span class="title">' . __('Choose a publisher', 'jeo') . '</span>';
$current_publisher = false;
if(is_tax('publisher')) {
$current_publisher = get_query_var('publisher');
$current_publisher = get_term_by('slug', $publisher, 'publisher');
$title = '<h1 class="title">' . $current_publisher->name . '</h1>';
}
if($publishers) : ?>
<div class="box">
<div class="clearfix">
<span class="arrow"></span>
<?php echo $title; ?>
</div>
</div>
<ul>
<?php if($current_publisher) : ?>
<li class="filter"><a href="<?php echo home_url('/'); ?>" title="<?php _e('All stories', 'jeo'); ?>"><?php _e('All stories', 'jeo'); ?></a></li>
<?php endif; ?>
<?php foreach($publishers as $publisher) : ?>
<?php if($current_publisher && $publisher->slug == $current_publisher->slug) continue; ?>
<li class="filter"><a href="<?php echo get_term_link($publisher); ?>" title="<?php echo $publisher->name; ?>"><?php echo $publisher->name; ?></a></li>
<?php endforeach; ?>
</ul>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#stage .choose-filter .box').toggle(function() {
$(this).parent().addClass('active');
}, function() {
$(this).parent().removeClass('active');
});
});
</script>
<?php endif; ?>
</div>
</div>
<?php elseif(is_search()) : ?>
<?php
global $wp_query;
if(empty($wp_query->posts))
echo '<h1 class="title">' . __('Nothing found for: ', 'jeo') . '"' . $_REQUEST['s'] . '"</h1>';
else
echo '<h1 class="title">' . __('Search results for: ', 'jeo') . '"' . $_REQUEST['s'] . '"</h1>';
?>
<?php elseif(is_category()) : ?>
<h1 class="title"><?php single_cat_title(); ?></h1>
<?php elseif(is_tag()) : ?>
<h1 class="title">Tag: <?php single_tag_title(); ?></h1>
<?php elseif(is_archive()) :
if (is_day()) :
printf('<h1 class="title">' . __('Daily Archives: %s', 'jeo' ), get_the_date() . '</h1>' );
elseif (is_month()) :
printf('<h1 class="title">' . __( 'Monthly Archives: %s', 'jeo' ), get_the_date(_x('F Y', 'monthly archives date format', 'jeo')) . '</h1>');
elseif (is_year()) :
printf('<h1 class="title">' . __('Yearly Archives: %s', 'jeo'), get_the_date(_x('Y', 'yearly archives date format', 'jeo')) . '</h1>');
else :
echo '<h1 class="title">' . __('Archives', 'jeo') . '</h1>';
endif;
endif; ?>