Category: WordPress

Professional and affordable website design. Based in King's Lynn, Norfolk.

How add a fee or charge to the cart for Woocommerce Virtual Products

Add the following to your theme’s functions.php file changing $specialfeecat = 86 to the ID of your category and $spfeeperprod = 0.05 to the amount that you want to add. Also change ‘Ticket Concierge Charge’ to the text that you want to describe the additional fee or charge. function df_add_ticket_surcharge( $cart_object ) { global $woocommerce;…
Read more

How to rename the coupon field on the Woocommerce checkout page

// rename the coupon field on the checkout page function woocommerce_rename_coupon_field_on_checkout( $translated_text, $text, $text_domain ) { // bail if not modifying frontend woocommerce text if ( is_admin() || ‘woocommerce’ !== $text_domain ) { return $translated_text; } if ( ‘Coupon code’ === $text ) { $translated_text = ‘Enter custom text for Coupon code box here’; }…
Read more

How to rename the “Have a Coupon?” message on the Woocommerce checkout page

// rename the “Have a Coupon?” message on the checkout page function woocommerce_rename_coupon_message_on_checkout() { return ‘Your custom text here’ . ‘ ‘ . __( ‘Click here to enter your code’, ‘woocommerce’ ) . ‘‘; } add_filter( ‘woocommerce_checkout_coupon_message’, ‘woocommerce_rename_coupon_message_on_checkout’ );

How to move jquery.js to the footer

If Google PageSpeed Insights shows wp-includes/js/jquery/jquery.js in Eliminate render-blocking JavaScript and CSS in above-the-fold content then this means that it needs moving to the footer of your site. The way to do this is put the following in your theme’s functions.php file. // Move jQuery to the footer wp_scripts()->add_data( ‘jquery’, ‘group’, 1 ); wp_scripts()->add_data( ‘jquery-core’,…
Read more

Great plugin for extending the Media Library

We have been working on a new look website for the 6th Quuen Elizabeth’s Own Gurkha Rifles which involved importing hundreds of images from Flickr which also needed all the captions from Flickr to be reinputted. We found a great plugin called Media Library Assistant which greatly helped with this process.

How to fix WordPress site when it displays Briefly unavailable for scheduled maintenance. Check back in a minute.

If you are trying to update WordPress plugins and they keep spinning and appear not to update and you stop the update process then you may see the message Briefly unavailable for scheduled maintenance. Check back in a minute. on both the backend and frontend of your site. The first thing is not to panic…
Read more

How to remove Company Details and other fields Woocommerce checkout

Simply paste this into the functions.php file for your theme but remember to delete those fields (lines) below those that you still want to appear on the Checkout page: // remove Order Notes from checkout field in Woocommerce add_filter( ‘woocommerce_checkout_fields’ , ‘alter_woocommerce_checkout_fields’ ); function alter_woocommerce_checkout_fields( $fields ) { unset($fields[‘billing’][‘billing_first_name’]); // remove the customer’s First Name…
Read more

How to change Ship to a different address? Woocommerce

Simply paste this into the functions.php file for your theme: // Change words Ship to a different address add_filter(‘gettext’, ‘translate_reply’); add_filter(‘ngettext’, ‘translate_reply’); function translate_reply($translated) { $translated = str_ireplace(‘Ship to a different address?’, ‘The words you want instead go here’, $translated); return $translated; }

A Lightbox plugin that actually works!

You may have noticed that after upgrading WordPress Lightbox suddenly stops working with your WordPress Galleries. After some frustation and trying several plugins we found one that, in our opinion, works beautifully (and on all devices too!). It is called Simple Lightbox. It works straight out of the box and also includes an automatic slideshow.…
Read more

How to deal with spam WordPress comments

Try the Anti-Spam plugin. No need for captchas – they say “just install it and it just works”. We also recommend subscribing to Akismet which comes ready installed with all WordPress sites.