Is my code correct to enqueue CSS on a specific page?

Try this: I hope, It will works. Explaination: In below code in “is_page( 42 )” where 42 is page id of about page. So, if about page’s id will be 42 then it’s enqueue the stylesheet for that page only. Also I define particular path for this CSS file by using wordpress function get_template_directory_uri(). function … Read more

is_front_page() variable not found

There are several issues with your code. is_front_page() is a PHP function, you need to call it within <?php ?>. The script need to be printed in HTML in order to make it work. Try this.. function wpse_363853_run_on_front() { ?> <script> window.addEventListener(“load”, function() { <?php if( is_front_page() ){ ?> console.log(“front page”); <?php } ?> }); … Read more

Update blog option during create new blog?

The wpmu_new_blog hook is indeed deprecated and shouldn’t be used; however, it works because it runs after the new site has been initialized (see wp_initialize_site()) which means the database tables for that site has been created and filled with the default options. So because you are updating the site’s options like default_comment_status, then you should … Read more

Set default value for “Additional CSS class(es)” for specific block types

A simple solution would be to register custom block style variations for the core/columns block and let the user select your custom padding settings from these, instead of editing class names in the extra classes field (which isn’t too comfortable from a user’s perspective). Gutenberg automatically outputs class names in the form is-style-(name of block … Read more