How to exclude categories from Category widget in functions.php

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

0
How to set HSTS headers in functions.php

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

0