forked from ywammontana/WaterTower
/
sidebar.php
124 lines (90 loc) · 3.76 KB
/
sidebar.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
<?php
/**
* Sidebar
* This file should contain all of the necessary to
* display the correct sidebar for each page throughout
* the website.
*/
// Archives/Blog Sidebar
if ( is_archive() || is_home() ) {
// Program Blogs Sidebar
if ( is_tax( 'program_taxo' ) ) {
$queried_object = get_queried_object();
$program_id = get_page_by_path( $queried_object->slug, OBJECT, 'program' )->ID;
$program = new ProgramInfo( $program_id );
?>
<div class="program-snapshot-container">
<h4><i class='fa fa-calendar'></i>Upcoming Schools<i class='fa fa-caret-down'></i></h4>
<?php if ( $program->schedule ) : ?>
<?php foreach ( $program->schedule as $program_instance ) : ?>
<div class="program-snapshot-instance">
<h6><?php echo $program_instance['quarter']; ?></h6>
<div>Start Date:<span class="right"><?php echo date( 'm/d/y', strtotime( $program_instance['start_date'] ) ); ?></span></div>
<div>End Date:<span class="right"><?php echo date( 'm/d/y', strtotime( $program_instance['end_date'] ) ); ?></span></div>
<div>Cost:<span class="right"><?php echo $program_instance['total_cost']; ?></span></div>
</div>
<?php
endforeach; ?>
<?php else : ?>
<p>Sorry, but there are currently no upcoming dates for this school. If you think this may be a mistake, please feel free to contact our registrar at registrar@ywammontana.org.</p>
<?php
endif; ?>
<a href="<?php echo of_get_option( 'apply_url' ); ?>" class="button">Apply Now</a>
</div>
<?php
// Standard Archives Sidebar
} else {
dynamic_sidebar( 'archives_sidebar' ); ?>
<div class="tag-cloud">
<h4><i class='fa fa-tags'></i>Popular Tags<i class='fa fa-caret-down'></i></h4>
<?php $args = array(
'smallest' => 12,
'largest' => 12,
'unit' => 'pt',
'number' => 25,
'format' => 'flat',
'separator' => "\n",
'orderby' => 'name',
'order' => 'ASC',
'exclude' => null,
'include' => null,
'topic_count_text_callback' => default_topic_count_text,
'link' => 'view',
'taxonomy' => 'post_tag',
'echo' => true,
'child_of' => null,
);
wp_tag_cloud( $args );
?>
</div>
<?php
}
// Single Sidebar
} elseif ( is_single() ) { ?>
<div class="post-author-container">
<h4><i class='fa fa-user'></i>Post Author<i class='fa fa-caret-down'></i></h4>
<?php
/**
* Display Author of Post in Sidebar
* So far not compatible with the "married_couples" array within
* the Authors Class. It only scans the singles array.
*/
$authors = new AuthorInfo( $post->ID );
foreach ( $authors->singles as $author ) {
echo get_the_post_thumbnail( $author['ID'], 'thumbnail-card' );
echo '<h5>' . $author['author_info']['display_name'] . '</h5>';
echo '<p>' . $author['author_info']['description'] . '</p>';
echo '<ul>';
echo '<li><a href="' . get_bloginfo( 'url' ) . '/author/' . $author['author_info']['user_login'] . '"><i class="fa fa-paper-plane-o"></i> View All Posts (' . $author['author_info']['post_count'] . ')</a></li>';
echo $author['author_info']['website'] ? '<li><a href="' . $author['author_info']['website'] . '"><i class="fa fa-globe"></i> ' . properize( $author['author_info']['first_name'] ) . ' Website </a></li>' : null ;
echo '<li><i class="fa fa-map-marker"></i> Hometown: ' . $author['author_info']['hometown'] . '</li>';
echo '</ul>';
}
?>
</div>
<?php dynamic_sidebar( 'single_sidebar' );
// Default Sidebar
} else {
dynamic_sidebar( 'default_sidebar' );
}
?>