New answers tagged

1

Only to append the solution from @luis-sanz, I will add the note that every theme has to have the style.css file enqueued. Following the example https://codex.wordpress.org/Function_Reference/wp_add_inline_style from the codex, we can use get_stylesheet_uri() function and append the dynamic CSS data using the wp_add_inline_style function in the following ...


1

wp_add_inline_style needs to be tied to an existing stylesheet in order to work properly. The inline styles will only be printed when the stylesheet they are attached to is enqueued. This is quite handy to control the scope of the inline styles. If the idea is to have them printed globally, the safest handle to tie them to is that of the active theme main ...



Top 50 recent answers are included