Advertisement
Digitalraindrops

Coroline Category Template

May 16th, 2012
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.58 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Category Page
  4. * A custom page template Page Name = Category Name .
  5. */
  6.  
  7. /**
  8.  * @package WordPress
  9.  * @subpackage Coraline
  10.  * @since Coraline 1.0
  11.  */
  12.  
  13. get_header(); ?>
  14.  
  15.         <div id="content-container">
  16.             <div id="content" role="main">
  17.  
  18.             <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  19.  
  20.                 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  21.                     <?php if ( is_front_page() ) { ?>
  22.                         <h2 class="entry-title"><?php the_title(); ?></h2>
  23.                     <?php } else { ?>
  24.                         <h1 class="entry-title"><?php the_title(); ?></h1>
  25.                     <?php } ?>
  26.  
  27.                     <div class="entry-content">
  28.                         <?php the_content(); ?>
  29.                         <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'coraline' ), 'after' => '</div>' ) ); ?>
  30.                         <?php edit_post_link( __( 'Edit', 'coraline' ), '<span class="edit-link">', '</span>' ); ?>
  31.                     </div><!-- .entry-content -->
  32.                
  33.                 <?php
  34.                     global $post;  
  35.                     $tmp_post = $post;  
  36.                     //Create a query for the category  
  37.                     $pageslug = $post->post_name;
  38.                     $args = array(
  39.                         'posts_per_page' => 30,
  40.                         'category_name' => $slug,
  41.                         'paged' => $paged
  42.                     );
  43.                     query_posts( $args );
  44.                     //Get the lines  
  45.                     get_template_part( 'loop', 'titles' );  
  46.                     //Reset our page to get the comments  
  47.                     $post = $tmp_post;
  48.                 ?>
  49.                
  50.                 </div><!-- #post-## -->
  51.    
  52.                 <?php comments_template( '', true ); ?>
  53.  
  54.             <?php endwhile; ?>
  55.  
  56.             </div><!-- #content -->
  57.         </div><!-- #content-container -->
  58.  
  59. <?php get_sidebar(); ?>
  60. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement