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
This commit is contained in:
Ryan Boren 2004-11-17 03:45:50 +00:00
parent 2663acc49a
commit cc06069384
2 changed files with 3 additions and 3 deletions

View File

@ -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 {

View File

@ -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');