2 better answer
source | link

The function comment_reply_link echos the function get_comment_reply_link. If you look at the source code you see, that up to 3 arguments are needed for a proper functionality.

  1. $args an array of optional arguments that overwrite the default values
  2. $comment an optional comment_id or WP_Comment object the comment should reply to.
  3. $post an optional post_id or WP_Post object where the comment is going to be displayed on.

If the function returns null, it cannot figure out the relating $post. Try to add this parameter to your function call, e.g. comment_reply_link(null, null, $post_id) or $comm.= get_comment_reply_link(null, $comment); (within your foreach loop).

If the function returns false, comments are disabled for this post.

Source: developer.wordpress.org

The function comment_reply_link echos the function get_comment_reply_link. If you look at the source code you see, that up to 3 arguments are needed for a proper functionality.

  1. $args an array of optional arguments that overwrite the default values
  2. $comment an optional comment_id or WP_Comment object the comment should reply to.
  3. $post an optional post_id or WP_Post object where the comment is going to be displayed on.

If the function returns null, it cannot figure out the relating $post. Try to add this parameter to your function call, e.g. comment_reply_link(null, null, $post_id).

If the function returns false, comments are disabled for this post.

Source: developer.wordpress.org

The function comment_reply_link echos the function get_comment_reply_link. If you look at the source code you see, that up to 3 arguments are needed for a proper functionality.

  1. $args an array of optional arguments that overwrite the default values
  2. $comment an optional comment_id or WP_Comment object the comment should reply to.
  3. $post an optional post_id or WP_Post object where the comment is going to be displayed on.

If the function returns null, it cannot figure out the relating $post. Try to add this parameter to your function call, e.g. comment_reply_link(null, null, $post_id) or $comm.= get_comment_reply_link(null, $comment); (within your foreach loop).

If the function returns false, comments are disabled for this post.

Source: developer.wordpress.org

1
source | link

The function comment_reply_link echos the function get_comment_reply_link. If you look at the source code you see, that up to 3 arguments are needed for a proper functionality.

  1. $args an array of optional arguments that overwrite the default values
  2. $comment an optional comment_id or WP_Comment object the comment should reply to.
  3. $post an optional post_id or WP_Post object where the comment is going to be displayed on.

If the function returns null, it cannot figure out the relating $post. Try to add this parameter to your function call, e.g. comment_reply_link(null, null, $post_id).

If the function returns false, comments are disabled for this post.

Source: developer.wordpress.org