Skip to content

Commit

Permalink
Allow for comment templates in the "/comment" sub-directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Tadlock committed Nov 1, 2013
1 parent e2da151 commit 75f4dbe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions functions/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,16 @@ function hybrid_comments_callback( $comment, $args, $depth ) {
if ( !isset( $hybrid->comment_template[$comment_type] ) ) {

/* Create an array of template files to look for. */
$templates = array( "comment-{$comment_type}.php" );
$templates = array( "comment-{$comment_type}.php", "comment/{$comment_type}.php" );

/* If the comment type is a 'pingback' or 'trackback', allow the use of 'comment-ping.php'. */
if ( 'pingback' == $comment_type || 'trackback' == $comment_type )
if ( 'pingback' == $comment_type || 'trackback' == $comment_type ) {
$templates[] = 'comment-ping.php';
$templates[] = 'comment/ping.php';
}

/* Add the fallback 'comment.php' template. */
$templates[] = 'comment/comment.php';
$templates[] = 'comment.php';

/* Allow devs to filter the template hierarchy. */
Expand Down

0 comments on commit 75f4dbe

Please sign in to comment.