Attaching a 2 x 4 to a door frame
How about a bar that fastens to the door frame? See below. Two knobs screw into the door frame and the adjustable bar fits over them. 



https://www.wish.com/product/55f7ec5f74135f27949f81f3?from_ad=goog_shopping&amp;_display_country_code=US&amp;_force_currency_code=USD&amp;pid=googleadwords_int&amp;c=%7BcampaignId%7D&amp;ad_cid=55f7ec5f74135f27949f81f3&amp;ad_cc=US&amp;ad_curr=USD&amp;ad_price=13.00&amp;campaign_id=7203534630&amp;gclid=CjwKCAjw95D0BRBFEiwAcO1KDHImYeLqPzXFHZlrqodUTA905VhaDoh9enymz1sFbED6Ia14VsjuPRoCv-MQAvD_BwE&amp;hide_login_modal=true&amp;share=web

Or just get two 1" pipe flanges and the appropriate length of threaded 1" pipe. Screw the flanges on to each end of the pipe and screw them into the door frame.