WordPress.org

Ready to get started?Download WordPress

Forums

customizing comments (3 posts)

  1. butcheee
    Member
    Posted 9 years ago #

    this has been killing me for the past few days...i'm using WP 1.5.

    i can't seem to get my comments to show up in my own personal template that i have created. i have a feeling that it has something to do with 'The Loop' or the comments loop.

    here's how i would like my single post to display.... http://butcheee.com/test/entry.php

    here's what it keeps happening... http://butcheee.com/wordpress/?p=1

    the default 'no comments' yet appears. here's the php code for my 'single.php'

    <div id="main">
    <div id="blog"> <!-- BLOG PROPER -->

    <div class="entry">
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    <?php the_title('<h2>','</h2>'); ?>
    <h3><?php the_time('l, F jS, Y @ g:ia'); ?> </h3>
    <p><?php comments_number('(0) comments','(1) comment','(%) comments'); ?> | find this in : <?php the_category(','); ?></p>
    <?php the_content(); ?>
    </div>

    </div>
    <div id="msg">
    <?php comments_template(); ?>
    </div>
    </div>

    <div id="side">
    <div id="comment">
    <h1>commentary</h1> <!-- COMMENTS -->
    <?php if ($comments) { ?>
    <div class="commententry">
    <?php foreach ($comments as $comment) { ?>
    <p class="short"><a href="<?php comment_author_url_link('linktext', 'before', 'after'); ?> "><?php comment_author(); ?> </a> says</p>
    <?php comment_text(); ?>
    <p><?php comment_time('H:M'); ?> </p>
    </div>
    <?php } // end for each comment ?>

    <?php } else { // this is displayed if there are no comments so far ?>
    <p><?php _e("No comments yet."); ?></p> <?php } ?>
    <?php endforeach; else: ?> <p><?php _e('Sorry, no posts matched your criteria. sucka!'); ?></p> <?php endif; ?>
    </div>

    </div>

    what i've done is pretty much cut and past code from the 'wp-comments.php' template and tried to put them to how my template is designed.

    i'm actually learning PHP as i'm putting this site together. so please be gentle on me. any help would be greatly appreciated.

  2. butcheee
    Member
    Posted 9 years ago #

    i got it working.... even though no one was friendly enough to help. maybe i didn't explain myself properly?

    still hackin' away at this code.

  3. Daisyhead
    Member
    Posted 8 years ago #

    I am trying to do this same thing and am cutting and pasting from my wp-comments.php template and putting that code into my single.php page. The comment form is showing but the actual comments aren't. I'd love some insight into how you fixed this issue. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.