From cc06069384b8362f6733de8fc1a7f57e2c26d5b5 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 17 Nov 2004 03:45:50 +0000 Subject: [PATCH] Allow comments on pages. Props: error http://wordpress.org/support/6/16759 git-svn-id: https://develop.svn.wordpress.org/trunk@1860 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/template-functions-comment.php | 4 ++-- wp-includes/template-functions-links.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/template-functions-comment.php b/wp-includes/template-functions-comment.php index 20a3ceb0dd..d7c3a7e81e 100644 --- a/wp-includes/template-functions-comment.php +++ b/wp-includes/template-functions-comment.php @@ -25,7 +25,7 @@ add_filter('comment_save_pre', 'balanceTags', 50); function comments_template() { global $withcomments, $post, $wpdb, $id, $comment; - if ( is_single() || $withcomments ) : + if ( is_single() || is_page() || $withcomments ) : $req = get_settings('require_name_email'); $comment_author = isset($_COOKIE['comment_author_'.COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_'.COOKIEHASH])) : ''; $comment_author_email = isset($_COOKIE['comment_author_email_'.COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_email_'.COOKIEHASH])) : ''; @@ -100,7 +100,7 @@ function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Com global $querystring_start, $querystring_equal, $querystring_separator; global $comment_count_cache; - if (! is_single()) { + if (! is_single() && ! is_page()) { if ('' == $comment_count_cache["$id"]) { $number = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved = '1';"); } else { diff --git a/wp-includes/template-functions-links.php b/wp-includes/template-functions-links.php index 7a94e1ac17..41d3cd1a28 100644 --- a/wp-includes/template-functions-links.php +++ b/wp-includes/template-functions-links.php @@ -50,7 +50,7 @@ function get_permalink($id = false) { } if ($idpost->post_status == 'static') { - return get_page_link(); + return get_page_link($idpost->ID); } $permalink = get_settings('permalink_structure');