Archived topic
Can I template what is generated by do_action( 'generate_header' ); ?
2 replies · Started by Jason on June 29, 2020
Hi there, I hope you are doing well and staying safe!!
I am trying to add a bit of custom PHP in my theme in order to create a dark mode toggle. I can't figure out where the generate_header action is coming from and I would appreciate advice on the best practice for how to add custom PHP in that spot in my child theme. Ideally, this is where I'd like to put it: https://imgur.com/pIwckWU
Thanks very much!
Hi there,
you can use the generate_after_header_content hook to add your content in that place.
@Jason, Have you got darkmode to work ?