Search code examples
phpwordpresswordpress-gutenberg

Wordpress add global & classic inline css programmatically


How is it possible to put the Wordpress global and classic inline css style into the head? I do not use the main function wp_head() so I am looking for a programmatically answer.

What I tried so far

add_action('wp_enqueue_scripts', function(){
    wp_enqueue_style('global-styles');
    wp_register_style('global-styles');
});

and

add_action('init', function(){
    wp_enqueue_global_styles();
});

But this does not make sense.

Hope somebody has the answer or can put me in the right direction.


Solution

  • Just looked in the core code to see which function is responsible for this If you want the global-styles-inline-css add manually put the code below between and

    <style><?php print_r(wp_get_global_stylesheet()); ?></style>