Add/enqueue custom script in WordPress

function theme_js() { wp_enqueue_script( 'theme_js', get_stylesheet_directory_uri() . '/js/custom.js', array( 'jquery' ), '1.0', true ); } add_action('wp_enqueue_scripts', 'theme_js'); In custom.js add the code like this: jQuery(function($) { $(document).ready(function(){ $('#sec1').addClass('shown'); $('#btn1').addClass('active'); });…

Continue ReadingAdd/enqueue custom script in WordPress

Save woocommerce order fields in uppercase

add_filter('woocommerce_checkout_posted_data', 'my_custom_woocommerce_checkout_posted_data'); function my_custom_woocommerce_checkout_posted_data($data){ if($data['billing_first_name']){ $data['billing_first_name'] = strtoupper($data['billing_first_name']); } if($data['billing_last_name']){ $data['billing_last_name'] = strtoupper($data['billing_last_name']); } //shipping fields too if($data['shipping_first_name']){ $data['shipping_first_name'] = strtoupper($data['shipping_first_name']); } if($data['shipping_last_name']){ $data['shipping_last_name'] = strtoupper($data['shipping_last_name']); } return $data; }

Continue ReadingSave woocommerce order fields in uppercase

Woocommerce price prefix/suffix

add_filter( 'woocommerce_get_price_html', 'custom_change_product_price_display' ); add_filter( 'woocommerce_cart_item_price', 'custom_change_product_price_display' ); function custom_change_product_price_display( $price ) { // Your additional text in a translatable string $text = __('Starting from'); // returning the text before…

Continue ReadingWoocommerce price prefix/suffix

Clear elementor cache

//Auto Clear REGENERATE CACHE OF ELEMENTOR add_action('save_post', 'clear_elementor_cache'); function clear_elementor_cache() { if ( did_action( 'elementor/loaded' ) ) { // Automatically purge and regenerate the Elementor CSS cache \Elementor\Plugin::instance()->files_manager->clear_cache(); } }

Continue ReadingClear elementor cache

Map

http://geojson.io https://www.openstreetmap.org/relation/9597 http://polygons.openstreetmap.fr/index.py                

Continue ReadingMap