-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontextualInfo.php
37 lines (31 loc) · 1.14 KB
/
contextualInfo.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
<?php if(is_search()) : ?>
<div id="contextualInfo">
<p><?php echo sprintf(__("Search results for <span>%s</span>", "mandm"), get_search_query()); ?></p>
</div>
<?php endif; ?>
<?php if(is_tag()) : ?>
<div id="contextualInfo">
<p><?php echo sprintf(__("Posts tagged with <span>%s</span>", "mandm"), single_tag_title("", false)); ?></p>
</div>
<?php endif; ?>
<?php if(is_category()) : ?>
<div id="contextualInfo">
<?php $categories = get_the_category(); ?>
<p><?php echo sprintf(__("所属分类: <span>%s</span>", "mandm"), $categories[0]->cat_name); ?></p>
</div>
<?php endif; ?>
<?php if(is_year()) : ?>
<div id="contextualInfo">
<p><?php echo sprintf(__("Posts published during <span>%s</span>", "mandm"), get_the_time('Y')); ?></p>
</div>
<?php endif; ?>
<?php if(is_month()) : ?>
<div id="contextualInfo">
<p><?php echo sprintf(__("Posts published during <span>%s</span>", "mandm"), get_the_time('F, Y')); ?></p>
</div>
<?php endif; ?>
<?php if(is_day()) : ?>
<div id="contextualInfo">
<p><?php echo sprintf(__("Posts published at <span>%s</span>", "mandm"), get_the_time('m/d/Y')); ?></p>
</div>
<?php endif; ?>