Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Blog
- */
- get_header(); ?>
- <div id="container">
- <div id="content" role="main">
- <?php
- // page id 672 will get category ID 20 posts, page 670 will get category 19 posts, page 682 will get both category 19 and 20 posts
- if (is_page('672') ) {
- $cat = array(20);
- } elseif ( is_page('670') ) {
- $cat = array(19);
- } elseif ( is_page('682') ) {
- $cat = array(19,20);
- } else {
- $cat = '';
- }
- $showposts = -1; // -1 shows all posts
- $do_not_show_stickies = 1; // 0 to show stickies
- $args=array(
- 'category__in' => $cat,
- 'showposts' => $showposts,
- 'caller_get_posts' => $do_not_show_stickies
- );
- $my_query = new WP_Query($args);
- ?>
- <?php if( $my_query->have_posts() ) : ?>
- <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
- <?php
- //necessary to show the tags
- global $wp_query;
- $wp_query->in_the_loop = true;
- ?>
- <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
- <div class="entry-post-title"><h3><?php the_title(); ?></h3></div>
- <div class="entry-content-post">
- <?php the_content('Read the rest of this entry ?'); ?>
- <small><p class="byline">Posted by <?php the_author() ?> on <?php the_time('l, F jS, Y | g:i A') ?> </p></small>
- <!-- <div class="entry-meta">
- <?php edit_post_link('Edit this entry', '<span class="entry-editlink">', '</span>'); ?>
- </div> -->
- </div>
- </div><!-- .post -->
- <?php /* Add a custom field with key "comments" (value is ignored) to turn on comments for a page! */ ?>
- <?php if ( get_post_custom_values('comments') ) comments_template(); ?>
- <?php endwhile; ?>
- <?php else : ?>
- <h2 class="center">Not Found</h2>
- <p class="center">Sorry, but you are looking for something that isn't here.</p>
- <?php get_search_form(); ?>
- <?php endif; ?>
- <?php comments_template( '', true ); ?>
- </div><!-- #content -->
- </div><!-- #container -->
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement