Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Category Page
- * A custom page template Page Name = Category Name .
- */
- /**
- * @package WordPress
- * @subpackage Coraline
- * @since Coraline 1.0
- */
- get_header(); ?>
- <div id="content-container">
- <div id="content" role="main">
- <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
- <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <?php if ( is_front_page() ) { ?>
- <h2 class="entry-title"><?php the_title(); ?></h2>
- <?php } else { ?>
- <h1 class="entry-title"><?php the_title(); ?></h1>
- <?php } ?>
- <div class="entry-content">
- <?php the_content(); ?>
- <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'coraline' ), 'after' => '</div>' ) ); ?>
- <?php edit_post_link( __( 'Edit', 'coraline' ), '<span class="edit-link">', '</span>' ); ?>
- </div><!-- .entry-content -->
- <?php endwhile; ?>
- </div><!-- #post-## -->
- <div id="post-<?php the_ID(); ?>-2">
- <?php
- global $post;
- $tmp_post = $post;
- //Create a query for the category
- $pageslug = $post->post_name;
- $args = array(
- 'posts_per_page' => 30,
- 'category_name' => $slug,
- 'paged' => $paged
- );
- query_posts( $args );
- //Get the lines
- get_template_part( 'loop', 'title' );
- //Reset our page to get the comments
- $post = $tmp_post;
- ?>
- <?php comments_template( '', true ); ?>
- </div><!-- #post-## -->
- </div><!-- #content -->
- </div><!-- #content-container -->
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement