Showing comment form under each paragraph In node.tpl.php, I have done some changes, like creating an array of paragraphs:

    $paragraphs = explode("&lt;p&gt;",render($content));


So, I have a for loop for showing the paragraphs, like:

$number = count($paragraphs);
if($page){

 print render($paragraphs[0]);
  for ($i=1;$i&lt;$number;$i++)
      {
         print render($paragraphs[$i]);

      &lt;a href="#commenting"&gt;Put comment for Paragraph &lt;?php echo $i?&gt;&lt;br&gt;&lt;/a&gt;
&lt;?php  } ?&gt;

   &lt;a id="commenting"&gt;&lt;?php print render($content['comments']); ?&gt;&lt;/a&gt; &lt;?php }?&gt;


As you can see I want to create a hyperlink under each paragraph, so when user click on it, they can put comment on the paragraph, But right now, when they click on the hyperlink, it will  jump to the end of the page, which has the comment form.
 If you check the CommentPress website, in the right column, you can see for example, it is said: 5 Comment on Paragraph 1, and when you click on it, it will show the comments and the comment form under that link, I want to have the same thing, I mean, when users click on the link under each paragraph, the comment form displays under that link instead of jumping to the end of the page.
I think you will need to do a couple of things. First is to create a comment form under each paragraph:

Drupal 7:

$comment = new stdClass;
$comment-&gt;nid = $nid;
$form = drupal_get_form('comment_form', $comment);

print render($form);


Then I would suggest using some jQuery to hide the forms, showing it only when the user clicks on the link. You can assign a unique class to the $form (see form API reference for more info) so that only the comment form for the specific paragraph shows, instead of all of them when any given link is clicked.