Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *Template Name: PageOfPosts
- */
- ?>
- <?get_header(); ?>
- <div id="container">
- <div id="content" role="main">
- <?php
- if ( is_page('15') ) {
- $cat = array(3);
- } elseif ( is_page('20') ) {
- $cat = array(4);
- } elseif ( is_page('32') ) {
- $cat = array(5, 7);
- } else {
- $cat = '';
- } $args = array(
- 'category__in' => $cat,
- 'caller_get_posts' => 1
- );
- if ( $paged > 1 ) {
- $args['paged'] = $paged;
- }
- $wp_query = new WP_Query($args); ?>
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
- <div class="post" id="post-<?php the_ID(); ?>">
- <h2><?php the_title(); ?></h2>
- <div class="entry">
- <?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>
- <?php wp_link_pages(array('before' => '<p>Pages: ', 'after'
- => '</p>', 'next_or_number' => 'number')); ?>
- </div>
- </div>
- <?php endwhile; endif; ?>
- <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
- <?php if ( $wp_query->have_posts() ) : ?>
- <?php while ( $wp_query->have_posts() ) :
- $wp_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(); ?>">
- <h2>" rel="bookmark" title="Permanent Link
- to <?php the_title_attribute(); ?>"><? php the_title(); ?></h2>
- <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --
- ></small>
- <div class="entry">
- <?php the_excerpt('Read the rest of this entry »'); ?>
- </div>
- </div>
- <?php endwhile; ?>
- <div class="navigation">
- <div class="alignleft"><?php
- if ( !is_single() && $paged > 1 ) {
- $attr = apply_filters( 'previous_posts_link_attributes', '' );
- echo '". preg_replace( '/&([^#])
- (?![a-z]{1,8};)/', '&$1', '« Previous Page' ) .' ';
- } ?></div>
- <div class="alignright"><?php
- if ( !$max_page ) {
- $max_page = $wp_query->max_num_pages; }
- if ( !$paged ) {
- $paged = 1;
- }
- $nextpage = intval($paged) + 1;
- if ( !is_single() && ( empty($paged) || $nextpage <= $max_page) ) {
- $attr = apply_filters( 'next_posts_link_attributes', '' );
- echo '". preg_replace('/&([^#])
- (?![a-z]{1,8};)/', '&$1', 'Next Page »') .' ';
- }
- ?></div>
- <?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>
- </div><!-- #content -->
- </div><!-- #container -->
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement