Divi hook not working [closed]

I hope you’re doing well! I wonder if adding a priority to your filter would fix the issue. In the past I’ve had filters not fire because the default priority was too high or low. Could you try something like this:

add_action( 'et_after_main_content', 'bgt_add_conditional_code_to_event_pages', 9999 );

And see if that resolves the issue? From what I read in the divi documentation the way you’re going about it should work I think.