Dynamic Banner Text based on Subdomain

You can put you code in functions.php where you define the string, for example: <?php function get_banner_text() { $url = $_SERVER[“REQUEST_URI”]; if (strpos($url, “bob.”)) { $banner_text = “Welcome to Agent Bob’s Portal!”; } else { $banner_text = “Default text here”; } return $banner_text; } ?> Afterwards for example in header.php of your theme you could … Read more

Change WooCommerce currency programmatically on AJAX request

This is how I solved it: /** * Force currency change */ add_filter( ‘wcml_client_currency’, function($current) { if(isset($_GET[‘currency’]) && $_GET[‘currency’]) return $_GET[‘currency’]; if(isset($_POST[‘currency’]) && $_POST[‘currency’]) return $_POST[‘currency’]; return $current; } ); And then in order for the above filter to be listened to, it’s important that you have added below code: add_action( ‘wp_ajax_quick_view_single_product’, __NAMESPACE__ . ‘\\quick_view_single_product’ … Read more