WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing a plugin that needs to display a custom link immediately near the comments. I have the option in the plugin admin to display before or after. I'm familiar with the comments_array, but that doesn't allow me to just add a string of html just before the comments or just after the comments but before the comment form.

-- ?? custom link before ?? --
-- ?? custom link after ?? --
share|improve this question
up vote 2 down vote accepted

do_action( 'comment_form_before' ); is called on line 1553 of /wp-includes/comment-template.php, right before the output of the comment form, that should handle that one for you. I'll update this if I can find the hook before the comments.


It seems like you might be able to modify Walker_Comment (found in the same file as above) to output the first link with __construct or something, but I can't give you precise implementation at the moment (for lack of time).

share|improve this answer
Yes, I was able to use the do_action to at least place the html before the form, after the comments_array. – Beer Jan 16 '12 at 15:26

I think, this is the post, that you search; all hooks on comments form visualized: http://wpengineer.com/2205/comment-form-hooks-visualized/

alternativ all hooks:

  • comment_form_before
  • comment_form_top
  • comment_form_before_fields
  • comment_form_after_fields
  • comment_form
  • comment_form_after
share|improve this answer
Thanks, it's a nice way to visualize those hooks but they're all about the comment_form and I needed to place html before/after the comments_array. – Beer Jan 16 '12 at 15:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.