Forums

add comments to custom page template (7 posts)

  1. Begin
    Member
    Posted 2 years ago #

    I try to add comments to my custom page template,
    so I wrote:

    <?php
    /*
    Template Name: GuitarForum
    */
    ?>
    
    <?php get_header(); ?>
    
    <?php comments_template(); ?>
    
    <?php get_footer(); ?>

    and I get:

    Leave a Reply

    Logged in as bentalgad. Log out ยป

    XHTML: You can use these tags: <abbr title=""> <acronym title=""> <b>

    <cite> ` <del datetime=""> <i> <q cite=""> <strike> </p>
    <p>(and a "leave comment box here)
    `

    Any Idea? thank's!

  2. @mercime
    Member
    Posted 2 years ago #

    That's what I would expect. What did you want to do?

  3. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Sorry? What's the problem?

  4. Mark / t31os
    Moderator
    Posted 2 years ago #

    Think i'd have the same question(s) as mercime and esmi (sorry), what did you expect it to do?

  5. Begin
    Member
    Posted 2 years ago #

    :-) that's nice.

    I thougt it was a problem (all this html tags),
    now I get it...

    anyway, after I leave a comment it does nothing,
    it just goes to a blank "wp-comments-post.php" page.

    isn't the new comment should appear in the page that i left
    a comment to?

  6. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    all this html tags

    Does your comments.php file include the tag wp_list_comments)? If so, does that tag include a callback parameter?

    isn't the new comment should appear in the page that i left
    a comment to?

    Depends. Is WP configured to hold comments for moderation?

  7. Begin
    Member
    Posted 2 years ago #

    1)my comments.php dosen't inlude the tag wp_list_comments,
    it has:

    <?php foreach ($comments as $comment) : ?>
    
    		<li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
    			<?php echo get_avatar( $comment, 32 ); ?>
    			<cite><?php comment_author_link() ?></cite> Says:
    			<?php if ($comment->comment_approved == '0') : ?>
    			<p>Your comment is awaiting moderation.</p>
    			<?php endif; ?>
    			<p><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('edit','&nbsp;&nbsp;',''); ?></p>
    			<?php comment_text() ?>
    		</li>
    
    	<?php
    		/* Changes every other comment to a different class */
    		$oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
    	?>
    
    	<?php endforeach; /* end for each comment */ ?>

    2)the wp is configured to hold comments for moderation.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags