Title: Using single.php for different comment page
Last modified: August 18, 2016

---

# Using single.php for different comment page

 *  [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/)
 * I am in the process of designing a new website for a friend and want the comments
   page to work differently than the index page. An example would be here, [http://www.morningsmiles.com/](http://www.morningsmiles.com/).
   I want the comment page to look like the main index page where the entry is listed
   above but I want the actual comment form and the comments to be listed below 
   in the pink portion of the page.
 * Are you still with me?
 * I’m assuming I could do this by using the single.php file and somehow calling
   that into use when people click on the comments link on the main index page, 
   but I’m unsure how this would work. If anyone could give some guidance, I would
   GREATLY appreciate it.

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/page/2/?output_format=md)

 *  Thread Starter [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404225)
 * Okay, I think I figured this out, somewhat. The only problem I’m having is that
   the actual comments aren’t showing up on my individual pages.
 * Example: [http://www.morningsmiles.com/2006/06/12/morning-smiles-is-coming-soon/](http://www.morningsmiles.com/2006/06/12/morning-smiles-is-coming-soon/)
 * Here’s my code:
 * <?php get_header(); ?>
 * <div id=”container”>
 * <div id=”top”>
 * <div id=”blog”>
 *  <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
 * <h1 id=”post-<?php the_ID(); ?>”><img src=”[http://morningsmiles.com/wp-content/themes/pinkcosmos/images/cosmo2.png”&gt](http://morningsmiles.com/wp-content/themes/pinkcosmos/images/cosmo2.png”&gt)
   </h1>
 * <div class=”entrybody”>
    <div class=”pad”> <?php the_content(‘<p class=”serif”
   >Read the rest of this entry »’); ?>
 * </div> <!– end PAD –>
    </div> <!– end ENTRY BODY –>
 * <div align=”center”><?php previous_post(‘« %’,”,’yes’) ?> <?php next_post(‘ %»’,”,’
   yes’) ?></div>
 * <?php endwhile; else: ?>
 * <?php _e(‘Sorry, no posts matched your criteria.’); ?>
 * <?php endif; ?>
 * </div> <!– end BLOG –>
 * <div id=”image”></div> <!– end IMAGE –>
    </div> <!– end TOP –>
 * <br clear=”all”>
 * <div id=”middle”>
 * <div id=”column1″>
    <h2><img src=”[http://morningsmiles.com/wp-content/themes/pinkcosmos/images/bullet.gif”&gt](http://morningsmiles.com/wp-content/themes/pinkcosmos/images/bullet.gif”&gt);
   Leave a Comment <img src=”[http://morningsmiles.com/wp-content/themes/pinkcosmos/images/bullet.gif”&gt](http://morningsmiles.com/wp-content/themes/pinkcosmos/images/bullet.gif”&gt);
   </h2>
 * <?php // Do not delete these lines
    if (‘comments.php’ == basename($_SERVER[‘
   SCRIPT_FILENAME’])) die (‘Please do not load this page directly. Thanks!’);
 *  if (!empty($post->post_password)) { // if there’s a password
    if ($_COOKIE[‘
   wp-postpass_’ . COOKIEHASH] != $post->post_password) { // and it doesn’t match
   the cookie ?>
 *  <p class=”nocomments”>This post is password protected. Enter the password to
   view comments.
 *  <?php
    return; } }
 *  /* This variable is for alternating comment background */
    $oddcomment = ‘alt’;?
   >
 * <?php if (‘open’ == $post->comment_status) : ?>
 * <?php if ( get_option(‘comment_registration’) && !$user_ID ) : ?>
    You must be/
   wp-login.php?redirect_to=<?php the_permalink(); ?>”>logged in
    to post a comment.
   
   <?php else : ?>
 * <form action=”<?php echo get_option(‘siteurl’); ?>/wp-comments-post.php” method
   =”post” id=”commentform”>
 * <?php if ( $user_ID ) : ?>
 * 
 * <?php else : ?>
 * <input type=”text” name=”author” id=”author” value=”<?php echo $comment_author;?
   >” size=”35″ tabindex=”1″ />
    <label for=”author”><small>Name <?php if ($req)
   echo “(required)”; ?></small></label>
 * <input type=”text” name=”email” id=”email” value=”<?php echo $comment_author_email;?
   >” size=”35″ tabindex=”2″ />
    <label for=”email”><small>Mail (will not be published)
   <?php if ($req) echo “(required)”; ?></small></label>
 * <input type=”text” name=”url” id=”url” value=”<?php echo $comment_author_url;?
   >” size=”35″ tabindex=”3″ />
    <label for=”url”><small>Website</small></label>
 * <?php endif; ?>
 * <!–<small>**XHTML:** You can use these tags: <?php echo allowed_tags(); ?></small
   >–>
 * <textarea name=”comment” id=”comment” cols=”60″ rows=”10″ tabindex=”4″></textarea
   >
 * <input name=”submit” type=”submit” id=”submit” tabindex=”5″ value=”Submit Comment”/
   >
    <input type=”hidden” name=”comment_post_ID” value=”<?php echo $id; ?>” />
 * <?php do_action(‘comment_form’, $post->ID); ?>
 * </form>
 * <?php endif; // If registration required and not logged in ?>
 * <?php endif; // if you delete this the sky will fall on your head ?>
 * </div>
 * <div id=”column2″>
      </div>
 * <div id=”column3″>
    <h2><img src=”[http://morningsmiles.com/wp-content/themes/pinkcosmos/images/bullet.gif”&gt](http://morningsmiles.com/wp-content/themes/pinkcosmos/images/bullet.gif”&gt);
   Comments <img src=”[http://morningsmiles.com/wp-content/themes/pinkcosmos/images/bullet.gif”&gt](http://morningsmiles.com/wp-content/themes/pinkcosmos/images/bullet.gif”&gt);
   </h2> <?php if ($comments) : ?> <h3 id=”comments”><?php comments_number(‘No Responses’,‘
   One Response’, ‘% Responses’ );?> to “<?php the_title(); ?>”</h3>
 *  <?php foreach ($comments as $comment) : ?>
 *  <cite><?php comment_author_link() ?></cite> Says:
    <?php if ($comment->comment_approved
   == ‘0’) : ?> _Your comment is awaiting moderation._ <?php endif; ?>
 *  <?php edit_comment_link(‘e’,”,”); ?></small>
 *  <?php comment_text() ?>
 *  <?php endforeach; /* end for each comment */ ?>
 *  <?php else : // this is displayed if there are no comments so far ?>
 *  <?php if (‘open’ == $post->comment_status) : ?>
    <!– If comments are open, but
   there are no comments. –>
 *  <?php else : // comments are closed ?>
    <!– If comments are closed. –> <p class
   =”nocomments”>Comments are closed.
 *  <?php endif; ?>
    <?php endif; ?> </div>
 * </div> <!– end MIDDLE –>
 * <div id=”footer”>
 * <?php get_footer(); ?>
 *  Thread Starter [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404228)
 * Okay, since no one is biting, here’s a simple version of what I’m trying to do.
   I am basically cutting and pasting from my wp-comments.php template and putting
   that code into my single.php page so I can customize where the comments form 
   and comments are in my layout (code is above). The comment form is showing on
   my individual entry page, etc., but the actual comments aren’t.
 * I’d would really love some help on this issue. Thanks in advance!
 *  Thread Starter [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404245)
 * Anyone? =(
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404252)
 * _ cutting and pasting from my wp-comments.php template and putting that code 
   into my single.php_
 * You must be behind by ages – wp-comments.php used to be in WordPress 1.2.x, and
   no more since WP 1.5.
 * You don’t need to cut/paste anything.
    You have to **call** the comments.php 
   into your single.php template file – inside the Loop. See how it is done in the
   Default.
 *  Thread Starter [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404507)
 * My bad. I typed the wrong file name. I *am* using the comments.php file with 
   the latest version of WP. My problem is that when I leave the code in to call
   in the comments.php file, I can’t customize where the comment form and actual
   comments lay in my layout. I thought I could get around this by taking the “pieces”
   of the comments.php file and placing them where I want them to be in my layout(
   single.php) but it doesn’t work right. I am getting the comment form but the 
   actual comments are not showing up.
 * I copied and pasted the code from my single.php file above and was wondering 
   if someone could take a look at it and see why the comments aren’t showing up.
   I would REALLY appreciate it.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404516)
 * Don’t hope. The code here is usually not readable (wondering why a mod didn’t
   delete it 😉 – use a pastebin service and post back the URI.
 * On the other hand I don’t understand this:
    _customize where the comment form
   and actual comments lay in my layout_ It is always pure CSS.
 *  Thread Starter [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404523)
 * If you look at this link, [http://www.morningsmiles.com/2006/06/13/movin-on-up/#comments](http://www.morningsmiles.com/2006/06/13/movin-on-up/#comments)
   you’ll see that I have the comments form down in the pink section of the page.
   I want the actual comments themselves to show just to the right of the comment
   form, in the pink section below the actual blog entry.
 * Every time I tried to call comments.php into the single.php page, the comment
   form and comments both showed wherever I placed the call. I don’t want that.
 * Here’s a link to the single.php page,
 * [http://www.morningsmiles.com/singlephp.txt](http://www.morningsmiles.com/singlephp.txt)
 * You can see the code to call the actual comments is under “column3” but yet the
   comments aren’t showing. That’s what I am needing help with.
 * Thanks for your patience Moshu!
 *  Thread Starter [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404524)
 * PS – please don’t pay any attention to my messy code. I’m in the process of designing
   a theme from scratch and I’ve yet to work out all the kinks. One problem I’m 
   having is with the footer portion of the layout being fluid and moving down when
   the middle (or pink section) grows longer. I figure I can fix that AFTER I get
   the actual code issues fixed. 🙂
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404538)
 * OK, I just re-read your posts above. The comments are not showing up because 
   you call the comments template (regardless it’s an “include” call or the code
   copied over) **after** closing the WP Loop. So the engine doesn’t know which 
   comments to show: outside the Loop they are not associated with the post.
 *  Thread Starter [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404544)
 * Okay, I read up on the Loop in the Codex and moved:
 * <?php endwhile; else: ?>
    <?php _e(‘Sorry, no posts matched your criteria.’);?
   > <?php endif; ?>
 * To the end of my file, after ALL of the comment code and still nothing. I will
   go back over it and see if I’m missing something. The updated code is now uploaded:
 * morningsmiles.com/singlephp.txt
 *  Thread Starter [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404560)
 * Okay. The comments still aren’t showing up after changing the placment of the
   end of the loop code. Suggestions?
 *  Thread Starter [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404580)
 * Ugh. I am at a loss as to what I’m doing wrong. I’ve gone back over my single.
   php file with a fine tooth come and cannot find why the comments aren’t showing.
   I’ve adjusted the end of the loop to include all of the code relevant to the 
   comments and still nothing…
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404582)
 * Just for the sake of testing.
    If you delete the comments code from it and call
   the comments template in the usual manner does it work?
 *  Thread Starter [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404585)
 * Yep. It’s just that the comment content (the comment form and actual comments)
   doesn’t show up where I want it in the design.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/#post-404587)
 * Question. Is the comments.php file’s code identical to what you are copy/pasting
   into the single?
 * I still don’t understand how comes it won’t display where you want it – especially
   now that you know you have to have it inside the Loop.
    Are there any comment
   related plugins activated?

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/page/2/?output_format=md)

The topic ‘Using single.php for different comment page’ is closed to new replies.

## Tags

 * [single.php](https://wordpress.org/support/topic-tag/single-php/)

 * 18 replies
 * 2 participants
 * Last reply from: [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * Last activity: [19 years, 12 months ago](https://wordpress.org/support/topic/using-singlephp-for-different-comment-page/page/2/#post-404727)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
