Skip to content
This repository
Browse code

add comment template

  • Loading branch information...
commit 37e5423b77cfe5ffefa968a9fd9d8227a28da23b 1 parent b6e4e92
Joel Kuzmarski authored March 22, 2013
17  lib/comments.php
@@ -28,21 +28,8 @@ function start_el(&$output, $comment, $depth, $args, $id = 0) {
28 28
 
29 29
     extract($args, EXTR_SKIP); ?>
30 30
 
31  
-  <li id="comment-<?php comment_ID(); ?>" <?php comment_class('media comment-' . get_comment_ID()); ?>>
32  
-    <?php echo get_avatar($comment, $size = '64'); ?>
33  
-    <div class="media-body">
34  
-      <h4 class="media-heading"><?php echo get_comment_author_link(); ?></h4>
35  
-      <time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo htmlspecialchars(get_comment_link($comment->comment_ID)); ?>"><?php printf(__('%1$s', 'roots'), get_comment_date(),  get_comment_time()); ?></a></time>
36  
-      <?php edit_comment_link(__('(Edit)', 'roots'), '', ''); ?>
37  
-
38  
-      <?php if ($comment->comment_approved == '0') : ?>
39  
-        <div class="alert">
40  
-          <?php _e('Your comment is awaiting moderation.', 'roots'); ?>
41  
-        </div>
42  
-      <?php endif; ?>
43  
-
44  
-      <?php comment_text(); ?>
45  
-      <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
  31
+  <li <?php comment_class('media comment-' . get_comment_ID()); ?>>
  32
+    <?php include(locate_template('templates/comment.php')); ?>
46 33
   <?php
47 34
   }
48 35
 
14  templates/comment.php
... ...
@@ -0,0 +1,14 @@
  1
+<?php echo get_avatar($comment, $size = '64'); ?>
  2
+<div class="media-body">
  3
+  <h4 class="media-heading"><?php echo get_comment_author_link(); ?></h4>
  4
+  <time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo htmlspecialchars(get_comment_link($comment->comment_ID)); ?>"><?php printf(__('%1$s', 'roots'), get_comment_date(),  get_comment_time()); ?></a></time>
  5
+  <?php edit_comment_link(__('(Edit)', 'roots'), '', ''); ?>
  6
+
  7
+  <?php if ($comment->comment_approved == '0') : ?>
  8
+    <div class="alert">
  9
+      <?php _e('Your comment is awaiting moderation.', 'roots'); ?>
  10
+    </div>
  11
+  <?php endif; ?>
  12
+
  13
+  <?php comment_text(); ?>
  14
+  <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?>

0 notes on commit 37e5423

Please sign in to comment.
Something went wrong with that request. Please try again.