/
blog-classic.php
executable file
·73 lines (73 loc) · 4.47 KB
/
blog-classic.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
<?php
/*
Template Name: Blog - Classic Layout
*/
get_header();
?>
<?php $blogs = blog_require();?>
<?php $pagination = get_option('blogclassicpagination'); ?>
<?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;
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-classic">
<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=180&w=630&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>
<?php if ( count( get_the_category() ) ) : ?>
<span class="categories-link"><?php echo __('Categories:','duotive').' <span class="title">'.get_the_category_list( ', ' ).'</span>'; ?></span>
<?php endif; ?>
<?php $tags_list = get_the_tag_list( '', ', ' ); ?>
<?php if ( $tags_list ): ?>
<span class="tag-links">
<?php echo __('Tags:','duotive').' <span class="title">'.$tags_list.'</span>'; ?>
</span>
<?php endif; ?>
<!-- end of post meta -->
</div>
<!--end of blog-classic -->
</div>
<?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(); ?>