Skip to content

Instantly share code, notes, and snippets.

@DougBeney
Last active August 22, 2016 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DougBeney/842f0b46f95344584bcb3194c9c5508f to your computer and use it in GitHub Desktop.
Save DougBeney/842f0b46f95344584bcb3194c9c5508f to your computer and use it in GitHub Desktop.
Barebones basic comments.php template
<!-- if comments are open -->
<?php if (comments_open) { ?>
<!-- Comment Form -->
<form action="<?php echo site_url('wp-comments-post.php'); ?>" method="post" >
<input type="hidden" name="comment_post_ID" id="comment_post_ID" value="<?php echo $post->ID ?>" />
<input placeholder="Name" type="text" name="author"/><br>
<input placeholder="Email" type="text" name="email"/><br>
<input placeholder="Website (optional)" type="text" name="url"/><br>
<textarea placeholder="Comment" name="comment" cols="30" rows="10"></textarea><br>
<button type="submit">Submit</button>
</form>
<!-- if comments are closed -->
<?php }else{ ?>
<h4 class="center">Comments are closed</h4>
<?php } ?>
<!-- Comment Feed -->
<?php foreach ($comments as $comment) { ?>
<?php echo get_avatar($comment, 100); ?><br>
<a href="<?php comment_author_url(); ?>"><?php comment_author(); ?></a>
<i><?php comment_date(); ?></i>
<p><?php comment_text(); ?></p>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment