-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
120 lines (90 loc) · 3.35 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php get_header(); ?>
<?php get_template_part( 'nav' ); // Navigation bar (nav.php) ?>
<div id="sectionHeaderBackground">
<div id="sectionHeader" class="container">
<div class="row">
<div class="span5">
<h1><?php wp_title(""); ?></h1>
</div>
<div class="span7">
<div class="pull-right"><?php get_search_form( $echo ); ?></div>
</div>
</div>
</div>
</div>
<!-- /end SectionHeader -->
<div id="mainBackground">
<div id="main" class="container blog">
<div class="row">
<div class="span8">
<section>
<!-- Start the Loop. -->
<?php $i = 1; ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- Test if the current post is in category 3. -->
<!-- If it is, the div box is given the CSS class "post-cat-three". -->
<!-- Otherwise, the div box is given the CSS class "post". -->
<?php if ( in_category('3') ) { ?>
<div class="post-cat-three">
<?php } else { ?>
<div class="post">
<?php } ?>
<!-- Display the Post Thumbnail -->
<?php // check if the post has a Post Thumbnail assigned to it.
if ( has_post_thumbnail() ) {?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
<?php the_post_thumbnail('blog-feature-thumb'); ?>
</a>
<?php } ?>
<div class="postHeader">
<!-- Display a comma separated list of the Post's Categories. -->
<p class="postMeta"><?php the_category(', '); ?></p>
<!-- Display the Title as a link to the Post's permalink. -->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
</div>
<!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
<div class="postDate">
<small><?php the_time('F jS, Y') ?></small>
</div>
<!-- Display the Post's content in a div box. -->
<div class="postEntry">
<?php the_excerpt(); ?>
</div>
</div> <!-- closes the first div box -->
<!-- Stop The Loop (but note the "else:" - see next line). -->
<?php endwhile; else: ?>
<!-- The very first "if" tested to see if there were any Posts to -->
<!-- display. This "else" part tells what do if there weren't any. -->
<p>Sorry, no posts matched your criteria.</p>
<!-- REALLY stop The Loop. -->
<?php endif; ?>
</section>
<?php global $wp_query;
$total_pages = $wp_query->max_num_pages;
if ($total_pages > 1){
$current_page = max(1, get_query_var('paged'));
echo '<div class="pagination pagination-centered">';
echo paginate_links(array(
'base' => get_pagenum_link(1) . '%_%',
'format' => '/page/%#%',
'current' => $current_page,
'total' => $total_pages,
'prev_text' => 'Prev',
'next_text' => 'Next' ,
'type' => 'list',
));
echo '</div>';
} ?>
</div>
<!-- /end blogroll -->
<?php if ( is_active_sidebar( 'blog-sidebar' ) ) : ?>
<div class="span4">
<?php dynamic_sidebar( 'blog-sidebar' ); ?>
</div>
<!-- Logo -->
<?php endif; ?>
</div>
</div>
</div>
<!-- /end mainBackground -->
<?php get_footer(); ?>