Forums

Missing comment function on template (3 posts)

  1. skritz
    Member
    Posted 1 year ago #

    Dear WordPresser,

    I made a second page template. The normal page template works fine. The new on is nearly the same, except, that it filters posts from a category and shows the content. It's also doing it's job as it shall.

    But the comments function won't show up in the new page template.

    Anybody an idea?

    Thank's a lot!

    Here's the template code:

    <?php
    /**
     * Template Name: Video
     */
    
    get_header(); ?>
    
    <div id="content">
    
        <?php query_posts('cat=5');?>
    
    	<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    
                    <h2><?php the_title(); ?></h2>
                    <?php twentyten_posted_on(); ?>
    
                    <?php the_content(); ?>
    
                <?php comments_template( '', true ); ?>
    
        <?php endwhile; ?>
    </div><!-- #content -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    try and add:
    global $withcomments; $withcomments = true;
    before:
    comments_template( '', true );

  3. skritz
    Member
    Posted 1 year ago #

    Perfect,

    it works fine.

    Thanks alchymyth.

Topic Closed

This topic has been closed to new replies.

About this Topic