Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: PageOfPosts
- */
- get_header(); ?>
- <div id="content" class="page">
- <?php
- // page id 34 will get category ID 6 posts, page 16 will get category 32 posts, page 28 will get category 17 posts
- if (is_page('9') ) {
- $cat = array(13);
- } elseif ( is_page('11') ) {
- $cat = array(6);
- } elseif ( is_page('2') ) {
- $cat = array(3);
- } elseif ( is_page('6') ) {
- $cat = array(4);
- } elseif ( is_page('8') ) {
- $cat = array(5);
- } elseif ( is_page('20') ) {
- $cat = array(7);
- } 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 class="entry" id="post-<?php the_ID(); ?>">
- <h1 class="entry-title"><?php the_title(); ?></h1>
- <div class="entry-byline">
- <?php edit_post_link('Edit', '[', ']'); ?>
- </div>
- <div class="entry-content">
- <?php the_content(); ?>
- <?php wp_link_pages('before=<p><strong>' . __('Pages:') . '</strong>&after=</p>'); ?>
- <div class="clear"></div>
- </div>
- </div><!--.entry-->
- <?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; ?>
- </div>
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement