Archived topic
Add snippet just before closing body tag
3 replies · Started by mkjj on August 3, 2021
This has been asked many times before, but the standard solutions did not do the trick. I need to include some CSS at the very bottom of the page. I have to override the CSS for the WP audioplayer. The stylesheets are included after the footer content. So, the usual wp_footer hook does not work. It puts the CSS before the included WP styleeteets. I would have to use !important, which I try to avoid.
Is there a solution in Generatepress out-of-the-box to include some stuff just before the closing body tag without modifying a template file?
Thank you!
Hi there,
use a Hook Element select the wp_footer hook and set the priority to a real high value, eg. 500.
The higher the priority value the further down the code it will be output.
Geez! I tried 100, but that was not enough. Haven't even thought about a higher value. Lessons learned. :-))
Thank you very much!
Glad to be of help :)