Insert posts on custom page template above comments
-
Hey all,
I’m completely stuck right now..
Basically what I have done is to create a custom page template.The idea is that I want to display posts from a specific category on this page (which I have managed to do). However, after this I would like to show the comments section for the page that is being viewed.
This is the bit that isn’t working.I think it could be something to do with the post category being defined at the start of the code.. Maybe it needs some form of stop or reset command to tell it to show the specific page data again and not posts?
Any help would be amazing!
Here’s the code that I have working at the moment..
<?php /* Template Name: Custom Page */ ?> <?php get_header() ?> <div id="content"> <?php if (have_posts()) : query_posts('showposts=100&cat=3'); ?> <?php while (have_posts()) : the_post(); ?> <div class="post"> <div class="postinfo"> <h2><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h2> </div> <div class="commentslink1-top"></div> <div class="postcontent"><?php the_content() ?><!--?php the_excerpt() ?--></div> </div> <?php endwhile; else: ?> <?php endif; ?> </div><!--content--> <?php get_sidebar() ?> <?php get_footer() ?>
I’ve tried adding the whole
<?php comments_template(); ?>
but with no success..Suggestions?
- The topic ‘Insert posts on custom page template above comments’ is closed to new replies.