Skip to content

Instantly share code, notes, and snippets.

View gist:da769ee12f519d91158b251013aa346d
add_action( 'wp_enqueue_scripts', 'dequeue_woocommerce_styles_scripts', 99 );
function dequeue_woocommerce_styles_scripts() {
if ( function_exists( 'is_woocommerce' ) ) {
if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) {
# Styles
wp_dequeue_style( 'woocommerce-general' );
wp_dequeue_style( 'woocommerce-layout' );
wp_dequeue_style( 'woocommerce-smallscreen' );
wp_dequeue_style( 'woocommerce_frontend_styles' );
View remove-simple-social-icons-widget-css.php
add_action( 'widgets_init', 'ic_remove_simple_social_css', 999 );
function ic_remove_simple_social_css() {
global $wp_registered_widgets;
$widgetNames = array_keys( $wp_registered_widgets );
$ssWidgets = [];
foreach ( $widgetNames as $name ) {
ben-heath / add-to-woocommerce-additional-info-tab-single-product.php
Last active Nov 12, 2021
Add content to WooCommerce Additional Information Tab on Single Products
View add-to-woocommerce-additional-info-tab-single-product.php
// This code should be added to the functions.php file of the child theme
// Add custom info to Additional Information product tab
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {
global $product;
$tabs['additional_information']['callback'] = 'custom_function_name'; // this is the function name which is included below
return $tabs;
jdevalk / logging-helper.php
Last active Dec 9, 2021
This little hack enables fatal error logging for your site, without creating an error log that is insanely big.
View logging-helper.php
* This changes logging to only log fatal errors. This file should go in your mu-plugins directory.
// Set the error logging to only log fatal errors
error_reporting( E_ERROR );
// Optional: change the location of your error log, it might be wise to put it outside your WP content dir.
// If you don't change it, the default place for this log is debug.log in your WP_CONTENT_DIR.
View gist:4fa3c4228a8bb53cc71d
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
ChromeOrange / gist:5778923
Created Jun 14, 2013
Remove postcode requirement if billing or shipping country is Ireland
View gist:5778923
* Remove postcode requirement if billing or shipping country is Ireland
* Add to your theme functions.php file
add_action( 'woocommerce_checkout_process', 'custom_country_check' );
function custom_country_check(){
global $woocommerce;