I'm currently developing a plugin for wordpress. My plugin-content gets fired on defined shortcode. I pass a parameter to the shortcode to make some conditionals. I am able to load JS conditionally, but I also need to load CSS conditionally.
Lets say I use the shortcode: [myshortcode css="dark"] I make a database query and inject the wanted css.
Is this somehow possible? I have read some threads about it. I know it is because the Code fires after head is loaded. I wasn't able to find a solution.
What options do I have?
Thank you!
css="dark"), and saving them as a variable in the PHP?