/
blog-dual-columns.php
executable file
·67 lines (67 loc) · 3.87 KB
/
blog-dual-columns.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
<?php
/*
Template Name: Blog - Dual Columns
*/
get_header();
?>
<?php $blogs = blog_require();?>
<?php $pagination = get_option('blogdualcolumnspagination'); ?>
<?php $title = get_the_title(); ?>
<?php foreach ( $blogs as $blog) :?>
<?php if ( is_page($blog->PAGE)): ?>
<?php $blog_ids = $blog->CATEGORIES; ?>
<div id="content-wrapper">
<?php get_sidebar(); ?>
<div id="content">
<?php $slider_display = get_option('slider_display'); if ( $slider_display == '' ) $slider_display = '1'; else $slider_display = get_option('slider_display'); ?>
<?php if ( $slider_display == 0 ) : ?>
<h1 class="page-title">
<?php echo $title; ?>
</h1>
<?php endif; ?>
<?php
global $more;
$more = 0;
$counter = 1;
if ( is_front_page () ) $paged = get_query_var( 'page' );
$wp_query = new WP_Query('post_type=post&posts_per_page='.$pagination.'&cat='.$blog_ids.'&paged=' . $paged);
if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post();
?>
<div class="post blog-dual-columns<?php if($counter%2 == 0) echo ' blog-dual-columns-last'; ?>">
<h2>
<a href="<?php the_permalink(); ?>" title="<?php echo __('Permalink to ', 'duotive').the_title_attribute( 'echo=0' ); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</h2>
<?php if ( has_post_thumbnail() ): ?>
<?php $thumbnail_src = wp_get_attachment_url( get_post_thumbnail_id($post->ID ) ); ?>
<?php $website_url = get_bloginfo('wpurl'); ?>
<?php $thumbnail_src = str_replace($website_url,'', $thumbnail_src); ?>
<a class="post-image" href="<?php the_permalink(); ?>" title="<?php the_title();?>">
<img src="<?php echo get_bloginfo('template_directory');?>/includes/timthumb.php?src=<?php echo $thumbnail_src; ?>&h=140&w=300&zc=1&q=100" alt="<?php the_title(); ?>" />
</a>
<?php endif; ?>
<?php the_content(''); ?>
<a class="more-link" href="<?php the_permalink(); ?>" title="<?php the_title();?>"><?php echo __('Read More »','duotive'); ?></a>
<div class="post-meta">
<span class="author"><?php echo __('posted by ','duotive'); ?><a class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="<?php echo get_the_author(); ?>"><?php echo get_the_author(); ?></a></span>
<span class="date"><?php the_time('jS'); echo ' '; the_time('F'); echo ' '; the_time('Y');?></span>
<!-- end of post meta -->
</div>
<!--end of blog-classic -->
</div>
<?php if($counter%2 == 0) echo '<div class="blog-dual-columns-sep"></div>'; ?>
<?php $counter++; ?>
<?php endwhile;endif;?>
<?php if(function_exists('wp_pagenavi')): ?>
<div id="navigation">
<?php wp_pagenavi();?>
</div>
<?php endif; ?>
<!-- end of content -->
</div>
<!--end of content wrapper -->
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php get_footer(); ?>