Category : code-snippets

I’m using a snippet of code in conjunction with a WooCommerce Dynamic Pricing and Discounts plugin. The total amount of savings, however, does not display correctly. It displays only on sale itens, not products labed as dynamic prices… How can I do that? Thank you very much for any help. cheers. Example function wc_discount_total() { ..

Read more

I use this plugin to filter my searches. in this section they explain how to create my own custom block. function prefix_register_block( $blocks ) { // ‘my_block’ corresponds to the block slug. $blocks[‘my_block’] = [ ‘name’ => __( ‘My Block’, ‘text-domain’ ), ‘render_callback’ => ‘prefix_my_block_render’, ]; return $blocks; } add_filter( ‘wp_grid_builder/blocks’, ‘prefix_register_block’, 10, 1 ); ..

Read more

I wanted to disable right click on my wordpress site. I have written a small snippet and inserted into body which disables right click, CTRL events and keyups. <body oncontextmenu="return false" onselectstart="return false" onkeydown="if ((arguments[0] || window.event).ctrlKey) return false"></body> but it is annoying when I want to copy something on site. is there a way ..

Read more