• I want to have a page for each of my post categories, displaying each post as would be with the blog template (excerpt view, chronological order). For example, all my recipe posts will be listed when you click ‘Recipes’ on the main navigation menu, similar to how my blog posts are listed when you click ‘Blog’.

    I’ve tried using the following code in creating a new page template (http://pastebin.com/raw.php?i=9TqRHc04). It is successful in that it lists only the posts with the category of the menu title, however it to be displayed in the same manner as a series of excerpt blog posts.

    <?php /*
    Template Name: ListPostsInCategoryThatHasSameNameAsPage
    */ ?>
    <?php get_header(); ?>
    <div id=”content”>
    <div id=”main”>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <h1><?php the_title(); ?></h1>
    <?php the_content(); ?>
    <?php endwhile; else: endif; ?>
    <?php query_posts(‘category_name=’.get_the_title().’&post_status=publish,future’);?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <h1>“><?php the_title(); ?></h1>
    <p><?php the_content(); ?>
    <?php endwhile; else: endif; ?>
    </div>
    </div>
    <?php get_footer(); ?>

    My site is http://www.beautyinthebackcountry.com. I’m using the Catch Everest theme. Can you please help me with figuring out the code for a customized page template? Perhaps it’s easier to edit the Blog Page Template.php? Any help will be GREATLY appreciated.

  • The topic ‘Customized Page Template To Display Posts of Specific Category’ is closed to new replies.