Fixed page comment bug in Atahualpa 3.4.6 WP theme

I finally got around to fixing a minor bug in the Atahualpa 3.4.6 WP theme. Pages with any existing comments lost the comment box so no one else could comment. This meant new pages were limited to one comment and viewers could not add any comments to old pages. This bug did not affect posts, just pages.

It took me awhile to figure out where it came from. As usual, I deactivated all my plugins and the bug did not go away so the next step is to replace the existing theme with the default WP theme. That fixed it so I knew it was the theme causing the problem. A visit to the theme support forum revealed the answer but it’s rather convoluted since the author made many attempts to fix it before finally fixing it right. I’ll save you the pain and give you the correct steps here.

  • Edit /wp-includes/comment-template.php
  • Find

HTML Code:
	$comment = get_comment($comment);
	$post = get_post($post);

make the following change

HTML Code:
	$comment = get_comment($comment);
	$post = get_post($comment->comment_post_ID);
  • Replace comment.php in the /wp-content/themes/atahualpa folder with the attached file (unzip it first) : comments.php.zip