It mainly depends on a theme, whether there is a hook, in which you can call an action.
Simple ways, how to do that:
- You insert your code directly into
single.php
, right above the code callingcomments_template()
, - You create a hook (e.g. above comments_template()) as
do_action('my_hook')
and then you hook into it your functionadd_action('my_hook', 'function_i_want_to_hook')
- Or you do the same as steps above, however, working with file, where comments template code resides, i.e.
comments.php