- This topic has 3 replies, 3 voices, and was last updated 10 years, 7 months ago by
Sakin.
-
AuthorPosts
-
October 27, 2013 at 9:22 am #16421
mkwan
MemberI 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 with no success:
<?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. 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.
October 27, 2013 at 11:31 am #16428Sakin
Keymaster@mkwan: I don’t get it why you need to create page template and add additional page for your each category. You can just add your category in your menu from custom menu “Appearance => Menu”. See more details about custom menu at http://catchthemes.com/blog/custom-menus-wordpress-themes/
January 31, 2014 at 3:54 am #19817Karen Higginson
MemberI need a page template that does not show header or menu, OR one that just doesn’t have the menu, so I can use it with specific pages. How do I go about this?
January 31, 2014 at 2:37 pm #19830Sakin
Keymaster@Karen Higginson: I have already replied you in http://catchthemes.com/support-forum/topic/remove-menu-bar-3/. Please don’t post same question twice.
-
AuthorPosts
- The topic ‘Customized Page Template’ is closed to new replies.