Theme Author
Tom
(@edge22)
Hi there,
You’ll want to use this hook: https://developer.ww.wp.xz.cn/reference/hooks/enqueue_block_editor_assets/
So you can do this:
add_ation( 'enqueue_block_editor_assets', function() {
wp_enqueue_style( 'your-handle', 'URL TO YOUR FILE' );
} );
Thread Starter
Karis
(@askel45)
I don’t know why that code is not working. I have tried other multiple variations and none seems to work. My CSS is located inside a plugin folder like assets/css/editor-style.css. For the theme itself, only this code seems to work to enqueue my CSS on the frontend (but I cannot get the editor styles to work with it either). wp_enqueue_style( 'theme-style', plugins_url( '/assets/css/style.css', __FILE__ ) );
Theme Author
Tom
(@edge22)
When you view the source of the editor and search for your file, is the URL correct?
Thread Starter
Karis
(@askel45)
You are spot on! I had to include the full path to the URL.