• Hello,
    Gutenberg rise and becomes very powerful!
    But how is it possible to add some JS to some WP site page by Gutenberg? It needs to:
    1) at <head> add some CSS: <style type=”text/css”>…</style>;
    2) at <body> add JS start functions: <div id=”some-js”></div> <script src=”some.js”></script>.
    Suppose that I need to make a different standalone Template? But when I open Gutenberg with Template editing and look at it HTML – I don’t see any kind of HTML there! So I need to start with HTML from scratch or from <body>, but then how I can add CSS?
    Explain with sample, please!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Maybe I have not been using Gutenberg in this way but ………

    Why is it any different?
    Why wouldn’t you add your custom CSS in the Customizer, and add your custom <div id> in the page template, and add your custom .js in the <head> of your page?

    Thread Starter johnynla

    (@johnynla)

    By another words, to make all correct – I’m asking which blocks <html>, <head>, etc will be added automatically by WP/Theme and which I can use at Template but which not?

    I think will be nice to add to Glossary info like “Gutenberg HTML structure” where devs can explain in details which blocks creates by which part of WP – Core/Theme/Post/etc and which blocks at which step users can add?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How add JS to WP page with Gutenberg?’ is closed to new replies.