Output after specific post in the loop

Unfortunately there’s no purposely provided hook available for this. The only hooks inside the loop are triggered at the start and the end of the hook.

There is the_post action, but this is probably far too generic to use (may cause undeseriable side effects) and is called a the wrong point for example:

The function used to iterate through the loop is the_post() which calls setup_postdata() to ‘set up’ the current post in the loop (sets up all the globals etc). This function triggers the action the_post.

… So this will be called at the top of the ‘content’ part of the post (typically – though not guaranteed – above the mark-up for the post).

Secondly, themes/plugins could cause the_post to be called from within the loop for things other than the current post in the loop, While you can ensure your callback is only triggered in between the start & end of the loop, you can’t be sure that all the times its triggered in between is when you intend your callback to run.