-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
100 lines (93 loc) · 4.02 KB
/
index.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
<?php get_header(); ?>
<section id="content">
<?php if (have_posts()) : ?>
<?php
if (is_author()){
$curauthor = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
}
?>
<?php if(is_archive() || is_search()){ ?>
<div id="breadcrumbs">
<?php if (is_category()) { ?>
<p><?php _e('Archive for the', 'boston'); ?> <strong>‘<?php single_cat_title(); ?>’</strong> <?php _e('Category', 'boston'); ?></p>
<?php } elseif( is_tag() ) { ?>
<p><?php _e('Posts Tagged with', 'boston'); ?> <strong>‘<?php single_tag_title(); ?>’</strong></p>
<?php } elseif (is_day()) { ?>
<p><?php _e('Archive for', 'boston'); ?> <strong><?php the_time('F jS, Y'); ?></strong></p>
<?php } elseif (is_month()) { ?>
<p><?php _e('Archive for', 'boston'); ?> <strong><?php the_time('F, Y'); ?></strong></p>
<?php } elseif (is_year()) { ?>
<p><?php _e('Archive for', 'boston'); ?> <strong><?php the_time('Y'); ?></strong></p>
<?php } elseif (is_author()) { ?>
<p><?php _e('Archive by', 'boston'); ?> <strong><?php echo $curauthor->display_name; ?></strong></p>
<?php } elseif (is_search()) { ?>
<p><?php _e('Search results for', 'boston'); ?> <strong><?php the_search_query(); ?></strong></p>
<?php } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<p><?php _e('Blog Archives', 'boston'); ?></p>
<?php } ?>
</div>
<?php } ?>
<?php while (have_posts()) : the_post(); ?>
<article class="post">
<div class="postTitle">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php
$showMeta = get_option('t-datecat');
if($showMeta != 'no'){
?>
<p class="articleCat"><?php _e('Written on', 'boston'); ?> <strong><?php the_time('j F Y, h:ia '); ?></strong> <?php _e('under', 'boston'); ?> <?php the_category(' ,'); ?></p>
<?php the_tags('<p><strong>Tagged with:</strong> ', ', ', '</p>'); ?>
<?php } ?>
</div>
<?php if(has_post_thumbnail()){ ?>
<div class="postImage">
<?php the_post_thumbnail('post'); ?>
</div>
<?php } ?>
<div class="postEntry">
<?php the_content(); ?>
</div>
<div class="postActions">
<ul>
<li class="pa-like"><a class="sitem like <?php like_status($post->ID); ?>" data-postid="<?php the_ID(); ?>" href="#"><span><?php _e('Likes', 'boston'); ?> (<em class="likeCount"><?php like_count($post->ID); ?></em>)</span></a></li>
<li class="sitem pa-share">
<span><?php _e('Share', 'boston'); ?></span>
<ul>
<li class="share-tw"><a rel="nofollow" href="http://twitter.com/home?status=<?php echo urlencode(get_the_title()); ?>+<?php the_permalink() ?>" title="Share this post on Twitter" target="_blank">Twitter</a></li>
<li class="share-fb"><a rel="nofollow" href="http://www.facebook.com/share.php?u=<?php the_permalink() ?>" title="Share this post on Facebook" target="_blank">Facebook</a></li>
<li class="share-gp"><a rel="nofollow" href="https://plus.google.com/share?url=<?php the_permalink() ?>" title="Share this post on Google Plus" target="_blank">Google+</a></li>
</ul>
</li>
<?php if(comments_open()){ ?>
<li class="pa-comments">
<?php comments_popup_link(__('Comments (0)', 'boston'), __('Comments (1)', 'boston'), __('Comments (%)', 'boston'), 'sitem'); ?>
</li>
<?php } ?>
</ul>
</div>
</article>
<?php endwhile; ?>
<div id="pagination">
<?php
global $wp_query;
$limit = 999999999;
echo paginate_links(array(
'base' => str_replace($limit, '%#%', esc_url(get_pagenum_link($limit))),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged')),
'total' => $wp_query->max_num_pages,
'mid_size' => 5,
'prev_next' => true
));
?>
</div>
<?php else : ?>
<article class="post">
<div class="postTitle">
<h2><?php _e('No articles found.', 'boston'); ?></h2>
</div>
</article>
<?php endif; ?>
</section>
<?php get_sidebar(); ?>
<?php get_footer(); ?>