-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontent.php
253 lines (233 loc) · 7.98 KB
/
content.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<?php
/**
* @package Cardume
* @subpackage Humus
*/
$section_icon = humus_get_term_icon_url($post->ID, 'section');
$display_author = get_field('display_author');
if(is_single()) :
$header_image = humus_get_header_image_url();
$media = get_post_meta($post->ID, 'media_oembed', true);
$content_columns = 'nine columns';
$media_columns = 'twelve columns';
if(get_post_type() == 'partner') {
$content_columns = 'ten columns';
$media_columns = 'ten columns';
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('full row'); ?>>
<header class="page-header post-header <?php if($header_image) echo 'header-image'; ?>" <?php if($header_image) echo 'style="background-image:url(' . $header_image . ')"'; ?>>
<div class="gradient"></div>
<?php do_action('humus_before_header_content'); ?>
<div class="header-content">
<div class="container">
<div class="one column">
<?php if($section_icon) : ?>
<img src="<?php echo $section_icon; ?>" alt="<?php single_term_title(); ?>" />
<?php else : ?>
<?php endif; ?>
</div>
<div class="ten columns">
<?php humus_breadcrumb(); ?>
<h1 class="page-title"><?php the_title(); ?></h1>
</div>
</div>
</div>
<?php do_action('humus_after_header_content'); ?>
</header>
<section class="page-content">
<div class="container">
<?php
$show_media = false;
if($media && $show_media) :
?>
<div class="row">
<?php if(get_post_type() == 'partner') : ?>
<div class="one column"> </div>
<?php endif; ?>
<div class="<?php echo $media_columns; ?>">
<section id="post-media">
<?php
do_action('humus_before_post_media');
echo $media;
do_action('humus_after_post_media');
?>
</section>
</div>
</div>
<?php endif; ?>
<?php if(get_post_type() !== 'partner') : ?>
<div class="twelve columns">
<div class="row">
<aside id="post-meta">
<div class="three columns alpha">
<?php if(get_post_type() == 'event' ) : ?>
<div class="event-date">
<p>
<span><?php _e('When', 'humus'); ?></span>
<span class="meta-content"><?php echo humus_get_event_date(); ?></span>
</p>
</div>
<?php else : ?>
<div class="post-date">
<p>
<span><?php _e('published', 'humus'); ?></span>
<span class="meta-content"><?php the_date(); ?></span>
</p>
</div>
<?php endif; ?>
</div>
<div class="five columns">
<?php if(get_post_type() == 'event') : ?>
<div class="event-location">
<p>
<span><?php _e('Where', 'humus'); ?></span>
<span class="meta-content"><?php echo humus_get_event_location(); ?></span>
</p>
</div>
<?php elseif($display_author) : ?>
<div class="post-author">
<p>
<span><?php _e('by', 'humus'); ?></span>
<span class="meta-content"><?php the_author(); ?></span>
</p>
</div>
<?php else : ?>
<?php endif; ?>
</div>
<div class="four columns omega">
<div class="share">
<ul>
<li>
<div class="fb-like" data-href="<?php the_permalink(); ?>" data-layout="box_count" data-show-faces="false" data-send="false"></div>
</li>
<li>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="<?php the_permalink(); ?>" data-lang="en" data-count="vertical">Tweet</a>
</li>
<li>
<div class="g-plusone" data-size="tall" data-href="<?php the_permalink(); ?>"></div>
</li>
</ul>
</div>
</div>
<div class="clearfix"></div>
</aside>
</div>
</div>
<div class="three columns">
<div class="row">
<aside id="post-terms">
<?php do_action('humus_before_single_post_meta'); ?>
<?php echo humus_get_post_tax_label(); ?>
<?php the_tags('<p class="tags"><span class="label">' . __('Tags', 'humus') . '</span>', ', ', '</p>'); ?>
<?php do_action('humus_after_single_post_meta'); ?>
</aside>
</div>
</div>
<?php else : ?>
<div class="one column"> </div>
<?php endif; ?>
<div class="<?php echo $content_columns; ?>">
<div class="row">
<section id="post-content" class="post-content">
<?php the_content(); ?>
</section>
</div>
</div>
</div>
</section>
</article>
<?php
elseif(humus_is_template('minimal')) :
?>
<div class="four columns">
<article id="post-<?php the_ID(); ?>" <?php post_class('minimal'); ?>>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="cover-link"></a>
<?php if(has_post_thumbnail()) : ?>
<div class="post-thumbnail">
<?php the_post_thumbnail('humus-wide-thumbnail', array('class' => 'scale-with-grid')); ?>
</div>
<?php endif; ?>
<header class="post-header">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php echo $section_icon; ?>" class="icon" /></a>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
</header>
<section class="post-content">
<?php the_excerpt(); ?>
</section>
</article>
</div>
<?php
else :
if(is_tax('section', 'albuns')) :
?>
<div class="three columns">
<article id="post-<?php the_ID(); ?>" <?php post_class('list clearfix'); ?>>
<?php if(has_post_thumbnail()) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail('humus-thumbnail', array('class' => 'scale-with-grid')); ?></a>
</div>
<?php endif; ?>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<p class="image-count"><?php
$image_count = humus_get_image_count();
printf(_n('%d image', '%d images', $image_count, 'humus'), $image_count);
?></p>
</article>
</div>
<?php else : ?>
<div class="six columns">
<article id="post-<?php the_ID(); ?>" <?php post_class('list clearfix'); ?>>
<?php if(has_post_thumbnail()) : ?>
<div class="three columns alpha">
<div class="post-thumbnail">
<?php do_action('humus_list_article_before_thumbnail'); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail('humus-thumbnail', array('class' => 'scale-with-grid')); ?></a>
</div>
</div>
<?php endif; ?>
<div class="three columns omega">
<?php if(has_post_thumbnail()) : ?>
<div class="with-thumbnail">
<?php endif; ?>
<header class="post-header">
<?php
$category = get_the_terms($post->ID, 'category');
if($category) :
$category = array_shift($category);
?>
<h3 class="category"><a href="<?php echo get_term_link($category); ?>"><?php echo $category->name; ?></a></h3>
<?php endif; ?>
<?php do_action('humus_list_article_before_title'); ?>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php do_action('humus_list_article_after_title'); ?>
<?php if($display_author) : ?>
<p class="author"><?php _e('by', 'humus'); ?> <span><?php the_author(); ?></span></p>
<?php endif; ?>
</header>
<section class="post-content">
<?php the_excerpt(); ?>
</section>
<footer class="post-meta">
<?php
$footer = apply_filters('humus_list_article_footer', '');
if($footer === '') {
the_tags('<p class="tags">', ', ', '</p>');
echo '<p class="date">' . get_the_date() . '</p>';
} else {
echo $footer;
}
?>
</footer>
<?php if(has_post_thumbnail()) : ?>
</div>
<?php endif; ?>
</div>
</article>
</div>
<?php
endif;
endif;
?>