hooks – Inject div from plugin into DOM, no matter what theme is installed


I write a small cookie consent plugin for a Multisite network installation. So, when the plugin will be finished, it will be available to all instances of a multisite installation.

To make it work, I need to inject a div with a certain ID into every DOM, no matter what theme is installed in that instance. I know, that I could do an “add_action” to inject it to the content or the wp_footer. But since the content sometimes is empty, and the wp_footer isn’t defined in every theme, I need some other way to inject my div.

Is there any possiblity to do it, no matter what theme is installed? Are there any hooks available, that every theme uses? Thank you very much in advance, I am pretty new to WordPress.

what ever 1 year 2021-12-11T07:32:15-05:00 0 Answers 0 views 0

Leave an answer