-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-blog.php
107 lines (74 loc) · 4.48 KB
/
page-blog.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
<?php
/**
* Template Name: Blog
*
* The blog page template displays the "blog-style" template on a sub-page.
*
*/
$layout = $ct_options['ct_layout'];
get_header();
/**
* The Variables
*
* Setup default variables, overriding them if the "Theme Options" have been saved.
*/
?>
<header id="page-header" class="sixteen columns alpha omega">
<div id="page-header-inner">
<div class="ten columns alpha omega">
<h3 class=""><?php the_title(); ?></h3>
</div>
<div class="clear"></div>
</div>
</header>
<?php if($layout == "left-sidebar" || $layout == "three-column") { ?>
<div id="left-sidebar" class="<?php if($layout == "three-column") { echo 'four columns alpha'; } else { echo 'five columns alpha'; } ?>">
<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Left Sidebar Pages') ) :else: endif; ?>
<div class="clear"></div>
</div>
<?php } ?>
<section id="content" class="<?php if($layout == "left-sidebar") { echo 'eleven omega'; } elseif($layout == "right-sidebar") { echo 'eleven'; } elseif($layout == "three-column") { echo 'eight'; } elseif($layout == "full-width") { echo 'sixteen alpha omega'; } ?> columns">
<?php
if ( get_query_var( 'paged') ) { $paged = get_query_var( 'paged' ); } elseif ( get_query_var( 'page') ) { $paged = get_query_var( 'page' ); } else { $paged = 1; }
$query_args = array(
'post_type' => 'post',
'paged' => $paged,
);
query_posts( $query_args );
if ( have_posts() ) {
$count = 0;
while ( have_posts() ) { the_post(); $count++; ?>
<article <?php post_class('marB18 pad20'); ?>>
<?php if ( has_post_thumbnail()) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
<?php the_post_thumbnail('thumbnail', array('class' => 'alignleft')); ?>
</a>
<?php endif; ?>
<h3 class="entry-title marB3"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php include(TEMPLATEPATH . '/includes/post-meta.php'); ?>
<p class="marT12 excerpt"><?php the_excerpt(); ?></p>
<a class="read-more right" href="<?php the_permalink(); ?>"><?php if($ct_read_more) { echo $ct_read_more; } else { echo "Read more →"; } ?></a>
</article>
<?php } // End WHILE Loop
} else {
?>
<?php } // End IF Statement ?>
<?php
$big = 999999999; // need an unlikely integer
// echo paginate_links( array(
// 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
// 'format' => '?paged=%#%',
// 'current' => max( 1, get_query_var('paged') ),
// 'total' => $the_post->max_num_pages
// ) );
echo paginate_links();
?>
<?php wp_reset_query(); ?>
</section>
<?php if($layout == "right-sidebar" || $layout == "three-column") { ?>
<div id="right-sidebar" class="<?php if($layout == "three-column") { echo 'four columns omega'; } else { echo 'five columns omega'; } ?>">
<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Right Sidebar Pages') ) :else: endif; ?>
<div class="clear"></div>
</div>
<?php } ?>
<?php get_footer(); ?>