Welcome to WP Beaches
WordPress Websites design specialists, based in the Northern Beaches, Sydney
Design, Develop, Host
RECENT POSTS
Set hostname and fqdn in Ubuntu 18.04 & 20.04 & 22.04
Hostname in Ubuntu 18.04 & 20.04 & 22.04You can find and change the hostname with the commands hostname or hostnamectl in Ubuntu 18.04 & 20.04, if you run the command on its own it will tell you what the current name is, the example below is named racknerd-lahostnamectlroot@racknerd-la:~# hostnamectl Static hostname: racknerd-la Icon name: computer-vm…
Block Modsec WAF from WordPress Website
You can block modsec WAF from your website via .htaccess with the following code… <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> This may help when in development, remove when finished to get the protection back. If there is an actual rule you keep triggering you can make an exemption by IP address… # Whitelist 401…
Change WordPress Domain URL with WP-CLI Tool
There are a few ways to change the main WordPress domain URL of a site – here is how to do it with the WP-CLI tool, which is probably the fastest and less problematic way of doing it. You’ll need to access your webhost via a shell session over SSH, once there switch directory to…
Change ‘You may also like’ and ‘You may be interested in’ WooCommerce text
The text strings ‘You may also like’ and ‘You may be interested in’ in WooCommerce can be changed with the gettext filter… add_filter( ‘gettext’, ‘bt_translate_like’ ); add_filter( ‘gettext’, ‘bt_translate_like_cart’ ); /** * @snippet Trsnslate “You may also like…” Text – WooCommerce * @how-to Watch tutorial @ https://businessbloomer.com/?p=19055 * @sourcecode https://businessbloomer.com/?p=595 * @author Rodolfo Melogli…
Show thumbnail images in WooCommerce order emails
Thumbnail images can be shown in WooCommerce order emails with the filter woocommerce_email_order_items_args add_filter( ‘woocommerce_email_order_items_args’, ‘bt_email_order_items_args’, 10, 1 ); /** * WooCommerce * Show thumbs in Order Email sent to customers */ function bt_email_order_items_args( $args ) { $args[‘show_image’] = true; $args[‘image_size’] = array( 150, 150 ); return $args; } If you want the images to…
Adding CSS styles into WooCommerce emails
WooCommerce emails can have CSS inline styles added via an action hook woocommerce_email_header, to add your CSS styles use the hook like below… add_action( ‘woocommerce_email_header’, ‘bt_add_css_to_email’ ); /** * WooCommerce * Add inline CSS to emails sent out */ function bt_add_css_to_email() { echo ‘ <style type=”text/css”> h1 { text-align: center !important; color: #c7c9c7; } </style></pre>…
Make price in WooCommerce an absolute value
You can make the prices displayed in WooCommerce an absolute value and remove the decimal .00 places with the WooCommerce woocommerce_price_trim_zeros filter. So for example to go from $50.00 to $50 In your functions.php add the following… /** * WooCommerce * Trim zeros in price decimals **/ add_filter( ‘woocommerce_price_trim_zeros’, ‘__return_true’ );
Change the WooCommerce return to shop and continue shopping URLs
You can change the WooCommerce shop URL with a filter that WooCommerce provides, this can be helpful especially if you have a one product based shop and you want your users to return to that product and not the default shop page URL. The filter to use is aptly named – woocommerce_return_to_shop_redirect – add in your…