From d3b14a607d6b7d42ce50f7e4bf7d62ac87acb72f Mon Sep 17 00:00:00 2001 From: rboren Date: Wed, 15 Sep 2004 02:50:29 +0000 Subject: [PATCH] Make comments_template() theme aware. git-svn-id: http://svn.automattic.com/wordpress/trunk@1660 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/template-functions-comment.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/wp-includes/template-functions-comment.php b/wp-includes/template-functions-comment.php index 2a3b2040ea..afe63cd932 100644 --- a/wp-includes/template-functions-comment.php +++ b/wp-includes/template-functions-comment.php @@ -25,7 +25,20 @@ function comments_template() { $comment_author_email = isset($_COOKIE['comment_author_email_'.$cookiehash]) ? trim(stripslashes($_COOKIE['comment_author_email_'.$cookiehash])) : ''; $comment_author_url = isset($_COOKIE['comment_author_url_'.$cookiehash]) ? trim(stripslashes($_COOKIE['comment_author_url_'.$cookiehash])) : ''; $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date"); - include(ABSPATH . 'wp-comments.php'); + + $wp_template = get_settings('template'); + if ($wp_template == 'default') { + $wp_template = ''; + } else { + $wp_template = ABSPATH . "wp-content/themes/$wp_template/comments.php"; + } + + if(! empty($wp_template) && file_exists($wp_template)) { + include($wp_template); + } else { + include(ABSPATH . 'wp-comments.php'); + } + endif; }