/
page-blog.php
73 lines (52 loc) · 2.55 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
<?php
/*
Template Name: Blog or News Page
*/
get_header(); ?>
<?php if (function_exists('vu_breadcrumbs')) vu_breadcrumbs(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post();
$show_category = get_post_meta($post->ID, 'show_category', $single = true);
?>
<h1 class="plain"><?php the_title(); ?></h1>
<div class="secmain">
<?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<?php endwhile; endif; ?>
<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
<?php
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
// $wp_query->query('cat=$whatcategory&showposts=15'.'&paged='.$paged);
if($show_category!='') { $wp_query->query('showposts=15&category_name='.$show_category.'&paged='.$paged); }
else { $wp_query->query('showposts=15'.'&paged='.$paged); }
?>
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<a href="<?php the_permalink() ?>">
<?php if(has_post_thumbnail()) { the_post_thumbnail(array(150,150), array("class" => "blogthumb left")); }
else { echo '<img src="'; bloginfo('stylesheet_directory'); echo '/functions/images/defaultpost.jpg" height="150" width="150" class="blogthumb left">'; }
?></a>
<h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<p><?php echo get_the_excerpt(); ?>...
<a href="<?php the_permalink(); ?>">KEEP READING</a></p>
<p><small>Posted on <?php the_time('l, F jS, Y') ?> in <?php the_category(', ') ?> | <?php the_tags('Tags: ', ', ', ''); ?> <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></small></p>
<hr />
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
</div>
<?php $wp_query = null; $wp_query = $temp;?>
<hr />
<div class="sidebaraddthis addthis_toolbox addthis_32x32_style addthis_default_style">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_email"></a>
<a class="addthis_button_print"></a>
<a class="addthis_button_google"></a>
<a class="addthis_button_compact"></a>
</div>
</div><!-- /secmain -->
</div><!-- /seccontent-->
<?php get_sidebar(); ?>
<?php get_footer(); ?>