Skip to content

Instantly share code, notes, and snippets.

Avatar

Damien Carbery damiencarbery

View GitHub Profile
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
<?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
ben-heath / add-to-woocommerce-additional-info-tab-single-product.php
Last active Nov 16, 2020
Add content to WooCommerce Additional Information Tab on Single Products
View add-to-woocommerce-additional-info-tab-single-product.php
<?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
jdevalk / logging-helper.php
Last active Feb 27, 2020
This little hack enables fatal error logging for your site, without creating an error log that is insanely big.
View logging-helper.php
<?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.
@ChromeOrange
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;
You can’t perform that action at this time.