Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: One Category
- */
- <?php get_header(); ?>
- <div class="span-24" id="contentwrap">
- <?php get_sidebars('left'); ?>
- <!-- Start this part is the normal page section -->
- <div class="span-14">
- <div id="content">
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
- <?php global $post; $tmp_post = $post; // Store the Post to reset ?>
- <div class="post" id="post-<?php the_ID(); ?>">
- <h2 class="title"><?php the_title(); ?></h2>
- <div class="entry">
- <?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) { the_post_thumbnail(array(300,225), array("class" => "alignleft post_thumbnail")); } ?>
- <?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')); ?>
- </div>
- </div>
- <?php endwhile; endif; ?>
- <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
- <!-- End this part is the normal page section -->
- <!-- Start this part is the category posts section -->
- <?php
- $pageslug = $post->post_name;
- $catslug = get_category_by_slug($pageslug);
- $catid = $catslug->term_id;
- $wp_query= null;
- $wp_query = new WP_Query();
- $args=array(
- 'cat' => $catid,
- 'paged' => $paged,
- showposts => 10,
- );
- $wp_query->query( $args );
- ?>
- <?php if ( $wp_query->have_posts() ) : ?>
- <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
- <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
- <h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
- <div class="postdate">Posted by <strong><?php the_author() ?></strong> on <?php the_time('F jS, Y') ?> <?php if (current_user_can('edit_post', $post->ID)) { ?> | <?php edit_post_link('Edit', '', ''); } ?></div>
- <div class="entry">
- <?php //if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) { the_post_thumbnail(array(200,160), array("class" => "alignleft post_thumbnail")); } ?>
- <?php //the_content('<strong>Read more »</strong>'); ?>
- <?php the_excerpt(); ?>
- </div>
- </div><!--/post-<?php the_ID(); ?>-->
- <?php endwhile; ?>
- <div class="navigation">
- <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
- <div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
- <div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
- <?php } ?>
- </div>
- <?php
- //Reset our page to get the sidebar
- $post = $tmp_post;
- ?>
- <?php endif; ?>
- <!-- End this part is the category posts section -->
- </div>
- </div>
- <?php get_sidebars('right'); ?>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement