WP Scripts and Styles console debug
Post

WP Scripts and Styles console debug is a simple plugin for getting the whole list of JS scripts and CSS styles loaded in any page, post, product or archive of any WordPress web site.¬†It shows both handle and filename, and … Read More

How to better target mobile devices with CSS
Post

With the permanent increase in mobile devices resolutions it becomes harder to target these based on screen width (there are plenty of 1920 x 1080 devices out there and some tablets go even higher, while there also are a lot … Read More

Force choosing a shipping method in WooCommerce cart
Post

Sometimes is necessary to have a shipping method selected in cart page, before proceeding to checkout. This can be achieved using a short jQuery function inserted in head via a php function added in functions.php: // force shipping method in … Read More

How to exclude categories from Category widget in functions.php
Post

Add the following function in functions.php of your active (child?) theme and adjust the category ID numbers: // Hide categories from WordPress category widget function mo_exclude_widget_categories($args){ $exclude = “1,3,4”; // add category IDs here $args[“exclude”] = $exclude; return $args; } … Read More

How to set HSTS headers in functions.php
Post

In cases where .htaccess changes is not possible¬†and there’s a WordPress in use the HSTS headers can be set using the following function: // HSTS Headers add_action( ‘send_headers’, ‘mo_strict_transport_security’ ); function mo_strict_transport_security() { header( ‘Strict-Transport-Security: max-age=15552001; includeSubDomains; preload’ ); } … Read More

How to set HSTS headers with .htaccess
Post

There are more “degrees” of HSTS and the headers can be defined in .htaccess as follows: 1 – Just set the HSTS headers and max-age as standard requires: Header always set Strict-Transport-Security “max-age=31536000”   2 – Add the HTTPS environment … Read More

How to redirect HTTP to HTTPS traffic with .htaccess
Post

Open the .htaccess file in the root of your web and add these rules: # HTTPS Redirect RewriteEngine On RewriteCond %{SERVER_PORT} ^80$ RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]   The “RewriteEngine On” is needed only once in the .htaccess file, so if … Read More