Adding ads code between comments
The end-callback of wp_list_comments() One way is to use the end-callback argument in: wp_list_comments( [ ‘end-callback’ => ‘wpse_comments_ads_injection’, … other arguments … ], $comments ); in addtion to your other wp_list_comments arguments, by defining: function wpse_comments_ads_injection( $comment, $args, $depth ) { static $instance = 0; $tag = ( ‘div’ == $args[‘style’] ) ? ‘div’ : … Read more