Last active
August 22, 2016 18:21
-
-
Save DougBeney/842f0b46f95344584bcb3194c9c5508f to your computer and use it in GitHub Desktop.
Barebones basic comments.php template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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