Title: Single static page with comments template
Last modified: August 19, 2016

---

# Single static page with comments template

 *  [greenzebra](https://wordpress.org/support/users/greenzebra/)
 * (@greenzebra)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/single-static-page-with-comments-template/)
 * I am trying to build a new page template that will allow me to edit content in
   the admin dashboard for the static page but also allow comments. any thoughts?

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [Peter Boosten](https://wordpress.org/support/users/pboosten/)
 * (@pboosten)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/single-static-page-with-comments-template/#post-1311648)
 * I think it’s a good thing 🙂
 * What problem are you facing?
 * Peter
 *  Thread Starter [greenzebra](https://wordpress.org/support/users/greenzebra/)
 * (@greenzebra)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/single-static-page-with-comments-template/#post-1311680)
 * I am learning html and css/php. I am editing the link template and have the comments
   code in but i cannot find the code to grab the content from the admin dashboard.
   I would like to be able to make new pages then apply the new content and allow
   comments on the page.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/single-static-page-with-comments-template/#post-1311699)
 * Sounds like you’re missing the Loop. Have you looked at [http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates](http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates)
 *  [Peter Boosten](https://wordpress.org/support/users/pboosten/)
 * (@pboosten)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/single-static-page-with-comments-template/#post-1311704)
 * Hmmm, not quite sure I do understand:
 * A minimal WordPress theme only needs an index.php, but to show posts on its own,
   one uses single.php. To display pages, one uses page.php.
 * The latter would be the one to edit, but, if you want comment fields on only 
   certain pages, one could create another template for such a page, say you want
   your ‘about’ page to be different from the other pages, you would also create
   an about.php template.
 * If you want several pages to look the same, you would probably be needing [custom page templates](http://www.boosten.org/page-templates-in-wordpress/).
 * The code to display the actual page contents, is described [here](http://codex.wordpress.org/The_Loop),
   and is basically the same for each template.
 * Peter
 *  Thread Starter [greenzebra](https://wordpress.org/support/users/greenzebra/)
 * (@greenzebra)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/single-static-page-with-comments-template/#post-1311721)
 * Here is what i have so far. I am getting it together but just need to figure 
   out how to size everything so it fits properly.
 * <?php
    /* Template Name: Perks Page Temp */ ?>
 * <?php get_header(); ?>
 * <div id=”content” class=”580px”>
 *  <?php if (have_posts()) : while (have_posts()) : the_post();?>
    <div class=”
   post”> <h2 id=”post-<?php the_ID(); ?>”><?php the_title();?></h2> <div class=”
   entrytext”> <?php the_content(‘<p class=”serif”>Read the rest of this page »</
   p>’); ?> </div> </div> <?php endwhile; endif; ?> <?php edit_post_link(‘Edit this
   entry.’, ‘<p>’, ‘</p>’); ?>
 * </div>
    <div id=”main”>
 * <?php
    /** * [@package](https://wordpress.org/support/users/package/) WordPress*
   @subpackage Default_Theme */
 * // Do not delete these lines
    if (!empty($_SERVER[‘SCRIPT_FILENAME’]) && ‘comments.
   php’ == basename($_SERVER[‘SCRIPT_FILENAME’])) die (‘Please do not load this 
   page directly. Thanks!’);
 *  if ( post_password_required() ) { ?>
    <p class=”nocomments”>This post is password
   protected. Enter the password to view comments.</p> <?php return; } ?>
 * <div id=”comments” class=”post-box”>
 *  <div class=”comment-content”>
 *  <div class=”comment-count”>
    [<?php comments_number(‘0 Comments’, ‘1 Comment’, ‘% Comments’ );?>](https://wordpress.org/support/topic/single-static-page-with-comments-template/?output_format=md#comments)
   </div>
 *  <?php if ( have_comments() ) : ?>
    <ol class=”commentlist clearfix”> <?php wp_list_comments(‘
   callback=magazeen_comment’ ); ?>
 *  <?php else : ?>
    <?php if (‘open’ == $post->comment_status) : ?> <ol class=”
   commentlist”> <li class=”no-comments”> <p>It‘s quite in here! Why not tell us
   about your experience [response](https://wordpress.org/support/topic/single-static-page-with-comments-template/?output_format=md#respond)?
   </p>
 *  <?php else : ?>
    <p class=”nocomments”>Comments are closed.</p> <?php endif;?
   > <?php endif; ?>
 *  </div>
 * </div>
 *  <?php echo $page ?>
 * <?php if( get_previous_comments_link() || get_next_comments_link() ) : ?>
 * <div class=”navigation arial clearfix”>
    <div class=”alignleft”><?php previous_comments_link();?
   ></div> <div class=”alignright”><?php next_comments_link(); ?></div> </div>
 * <?php endif; ?>
 * <?php if (‘open’ == $post->comment_status) : ?>
 * <div id=”respond” <?php post_class( ); ?> style=”margin-top:10px; padding:15px;”
   >
 *  <div class=”post-meta clearfix”>
 *  <h3 class=”post-title-small left”>Leave a Response</h3>
 *  <p class=”post-info right”>
    <small><?php cancel_comment_reply_link(); ?></small
   > </p>
 *  </div><!– End post-meta –>
 *  <div class=”post-box”>
 *  <div class=”page-content”>
 *  <?php if ( get_option(‘comment_registration’) && !$user_ID ) : ?>
    <p>You must
   be /wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>”>logged
   in
    to post a comment.</p>
    <?php else : ?>
 *  <form action=”<?php echo get_option(‘siteurl’); ?>/wp-comments-post.php” method
   =”post” id=”commentform”>
 *  <?php if ( $user_ID ) : ?>
 * </p>
 *  <?php else : ?>
 *  <p><input type=”text” name=”author” id=”author” value=”<?php echo $comment_author;?
   >” size=”32″ tabindex=”1″ class=”input” <?php if ($req) echo “aria-required=’
   true'”; ?> />
    <label for=”author”><small>Name <?php if ($req) echo “(required)”;?
   ></small></label></p>
 *  <p><input type=”text” name=”email” id=”email” value=”<?php echo $comment_author_email;?
   >” size=”32″ tabindex=”2″ class=”input” <?php if ($req) echo “aria-required=’
   true'”; ?> />
    <label for=”email”><small>eMail (will not be published) <?php 
   if ($req) echo “(required)”; ?></small></label></p>
 *  <?php endif; ?>
 *  <p><textarea name=”comment” id=”comment” cols=”” rows=”10″ tabindex=”4″ class
   =”input” style=”width:95%; display:inline;”></textarea></p>
 *  <p><input name=”submit” type=”submit” class=”submit-comment” id=”submit” tabindex
   =”5″ value=”Submit Comment” />
    <?php comment_id_fields(); ?> </p> <?php do_action(‘
   comment_form’, $post->ID); ?>
 *  </form>
 *  <?php endif; // If registration required and not logged in ?>
 *  </div>
 *  </div>
 * </div>
 * <?php endif; // if you delete this the sky will fall on your head ?>
 * <?php get_footer(); ?>
 *  Thread Starter [greenzebra](https://wordpress.org/support/users/greenzebra/)
 * (@greenzebra)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/single-static-page-with-comments-template/#post-1311741)
 * Ok progress. i cannot seem to get the footer to fill out tot the edges and the
   comments are not showing up. please help.
 * <?php
    /* Template Name: Perks Page Temp */ ?>
 * <?php get_header(); ?>
 * <div id=”main-content” class=”clearfix”>
 *  <div class=”container”>
 *  <div class=”col-580 left”>
 * <div id=”content” class=”widecolumn”>
 *  <?php if (have_posts()) : while (have_posts()) : the_post();?>
    <div class=”
   post”> <h2 id=”post-<?php the_ID(); ?>”><?php the_title();?></h2> <div class=”
   entrytext”> <?php the_content(‘<p class=”serif”>Read the rest of this page »</
   p>’); ?> </div> </div> <?php endwhile; endif; ?> <?php edit_post_link(‘Edit this
   entry.’, ‘<p>’, ‘</p>’); ?>
 * </div>
    <div id=”main”>
 * <?php
    /** * [@package](https://wordpress.org/support/users/package/) WordPress*
   @subpackage Default_Theme */
 * // Do not delete these lines
    if (!empty($_SERVER[‘SCRIPT_FILENAME’]) && ‘comments.
   php’ == basename($_SERVER[‘SCRIPT_FILENAME’])) die (‘Please do not load this 
   page directly. Thanks!’);
 *  if ( post_password_required() ) { ?>
    <p class=”nocomments”>This post is password
   protected. Enter the password to view comments.</p> <?php return; } ?>
 * <div id=”comments” class=”post-box”>
 *  <div class=”comment-content”>
 *  <div class=”comment-count”>
    [<?php comments_number(‘0 Comments’, ‘1 Comment’, ‘% Comments’ );?>](https://wordpress.org/support/topic/single-static-page-with-comments-template/?output_format=md#comments)
   </div>
 *  <?php if ( have_comments() ) : ?>
    <ol class=”commentlist clearfix”> <?php wp_list_comments(‘
   callback=magazeen_comment’ ); ?>
 *  <?php else : ?>
    <?php if (‘open’ == $post->comment_status) : ?> <ol class=”
   commentlist”> <li class=”no-comments”> <p>It‘s quite in here! Why not tell us
   about your experience [response](https://wordpress.org/support/topic/single-static-page-with-comments-template/?output_format=md#respond)?
   </p>
 *  <?php else : ?>
    <p class=”nocomments”>Comments are closed.</p> <?php endif;?
   > <?php endif; ?>
 *  </div>
 * </div>
 *  <?php echo $page ?>
 * <?php if( get_previous_comments_link() || get_next_comments_link() ) : ?>
 * <div class=”navigation arial clearfix”>
    <div class=”alignleft”><?php previous_comments_link();?
   ></div> <div class=”alignright”><?php next_comments_link(); ?></div> </div>
 * <?php endif; ?>
 * <?php if (‘open’ == $post->comment_status) : ?>
 * <div id=”respond” <?php post_class( ); ?> style=”margin-top:10px; padding:15px;”
   >
 *  <div class=”post-meta clearfix”>
 *  <h3 class=”post-title-small left”>Leave a Response</h3>
 *  <p class=”post-info right”>
    <small><?php cancel_comment_reply_link(); ?></small
   > </p>
 *  </div><!– End post-meta –>
 *  <div class=”post-box”>
 *  <div class=”page-content”>
 *  <?php if ( get_option(‘comment_registration’) && !$user_ID ) : ?>
    <p>You must
   be /wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>”>logged
   in
    to post a comment.</p>
    <?php else : ?>
 *  <form action=”<?php echo get_option(‘siteurl’); ?>/wp-comments-post.php” method
   =”post” id=”commentform”>
 *  <?php if ( $user_ID ) : ?>
 * </p>
 *  <?php else : ?>
 *  <p><input type=”text” name=”author” id=”author” value=”<?php echo $comment_author;?
   >” size=”32″ tabindex=”1″ class=”input” <?php if ($req) echo “aria-required=’
   true'”; ?> />
    <label for=”author”><small>Name <?php if ($req) echo “(required)”;?
   ></small></label></p>
 *  <p><input type=”text” name=”email” id=”email” value=”<?php echo $comment_author_email;?
   >” size=”32″ tabindex=”2″ class=”input” <?php if ($req) echo “aria-required=’
   true'”; ?> />
    <label for=”email”><small>eMail (will not be published) <?php 
   if ($req) echo “(required)”; ?></small></label></p>
 *  <?php endif; ?>
 *  <p><textarea name=”comment” id=”comment” cols=”” rows=”10″ tabindex=”4″ class
   =”input” style=”width:95%; display:inline;”></textarea></p>
 *  <p><input name=”submit” type=”submit” class=”submit-comment” id=”submit” tabindex
   =”5″ value=”Submit Comment” />
    <?php comment_id_fields(); ?> </p> <?php do_action(‘
   comment_form’, $post->ID); ?>
 *  </form>
 *  <?php endif; // If registration required and not logged in ?>
 *  </div>
 *  </div>
 * </div>
 * <?php endif; // if you delete this the sky will fall on your head ?>
 * <?php get_footer(); ?>
 *  [Peter Boosten](https://wordpress.org/support/users/pboosten/)
 * (@pboosten)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/single-static-page-with-comments-template/#post-1311744)
 * Maybe it’s about time you started to provide an URL: it’s way easier to see the
   site in action and give some meaningful advice.
 * Peter
 *  Thread Starter [greenzebra](https://wordpress.org/support/users/greenzebra/)
 * (@greenzebra)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/single-static-page-with-comments-template/#post-1311748)
 * got it, my test page is: [http://greenzebraconcierge.com/about/my-new-page/](http://greenzebraconcierge.com/about/my-new-page/)
 *  Thread Starter [greenzebra](https://wordpress.org/support/users/greenzebra/)
 * (@greenzebra)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/single-static-page-with-comments-template/#post-1311752)
 * and as i seem to click through the rest of my website I am noticing that the 
   footer is not bleeding out to the edges. Sorry I am such a rookie

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Single static page with comments template’ is closed to new replies.

 * 9 replies
 * 3 participants
 * Last reply from: [greenzebra](https://wordpress.org/support/users/greenzebra/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/single-static-page-with-comments-template/#post-1311752)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
