How can I add Block Style support to the core HTML block in Gutenberg?

Block Style Variations allow providing alternative styles to existing blocks using filters, as explained here. Here are some examples for your case using the server-side functions (php). You can either add the css style inline: register_block_style( ‘core/html’, array( ‘name’ => ‘full-width-video’, ‘label’ => __( ‘Full Width Video’ ), ‘inline_style’ => ‘.wp-block-html.is-style-full-width-video { width:100%; }’, ) … Read more

Vimeo froogaloop

so I’m not sure the enqueuing is even happening No, it’s not, because you only registered the scripts, but never enqueued them — which should be done using wp_enqueue_script(). Also, you should make frogaloop as a dependency for your snippet.js script. Hence, register the frogaloop script before your snippet.js script. // Register the scripts. wp_register_script( … Read more

Adding tawk.to code just before body tag on functions.php file

You can the code to head or before body tag this way. Add this code at the last of functions.php add_action( ‘wp_head’, function() { ?> <!–Start of Tawk.to Script–> <script type=”text/javascript”> var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date(); (function(){ var s1=document.createElement(“script”),s0=document.getElementsByTagName(“script”)[0]; s1.async=true; s1.src=”https://embed.tawk.to/5b54359ee21878736ba23110/default”; s1.charset=”UTF-8″; s1.setAttribute(‘crossorigin’,’*’); s0.parentNode.insertBefore(s1,s0); })(); </script> <?php } ); Hope it helps

How to make custom total price reactive in navigation

Using woocommerce woocommerce_add_to_cart_fragments filter you can do that. Going by the id attribute that you currently have for the span that displays the cart total, you can use the following code add_filter(‘woocommerce_add_to_cart_fragments’, ‘bt_update_cart_total’); function bt_update_cart_total ($fragments) { $fragments[‘#order-total-price’] = ‘<span id=”order-total-price”>’ . WC()->cart->get_cart_subtotal() . ‘</span>’; return $fragments; } Add this code to your functions.php file … Read more

Can the index.asset.php file be used with the enqueue_block_editor_assets action?

Yes you can use the index.asset.php file in the ‘enqueue_block_editor_assets’ action. I guess you missed to npm install the dependencies you want to use and import them in your script. That’s how @wordpress/scripts generates your asset.php file. If you do not import the dependencies in your JavaScript files the dependency management of asset.php wont work. … Read more

combining js scripts from a js newb [closed]

The jQuery(document).ready event is called when the document DOM is ready to be manipulated. In earlier days we attached all our handlers to document.load, but this waits until all images are loaded too, and most of the time one doesn’t need that. There are three equivalent ways of hooking into this event, and a fourth … Read more