Skip to content

Instantly share code, notes, and snippets.

@eri-trabiccolo
eri-trabiccolo / rss_widget_links_new_window.php
Last active January 1, 2024 17:54
open wordpress rss widget links in a new window
@kontikidigital
kontikidigital / style
Last active June 23, 2019 10:36
Genesis: Add a separator between menu items in site header
/* Add a separator between menu items in site header */
.site-header ul.menu > li a {
display: inline-block;
vertical-align: middle;
}
.site-header ul.menu > li:after {
content: "|";
font-size: 0.9em;
}
@bekarice
bekarice / wc-align-cart-buttons.css
Created October 2, 2014 23:44
Align WooCommerce Add to Cart Buttons (MAY CHANGE WITH THEME)
a.added_to_cart.wc-forward {
bottom: 0;
position: absolute;
display: block;
bottom: 0px;
}
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
min-height: 295px !important;
@ChromeOrange
ChromeOrange / gist:9486596
Last active June 17, 2016 09:34
Check the cart for specific shipping classes, remove Free Shipping if they are present
/**
* Check the cart for specific shipping classes, remove Free Shipping if they are present
*
* This code will remove free shipping if a product is in the cart that can not be delivered for free
* Assign a shipping class to those products and add the slug to the $freeshipping_array
* Multiple shipping classes can be added to the array
*
* Add the code to your theme functions.php file
*/
add_filter( 'woocommerce_package_rates', 'unset_free_shipping_when_product_in_cart' , 10, 1 );
@BFTrick
BFTrick / gettext-filter.php
Last active August 18, 2022 18:53
Use the gettext WordPress filter to change any translatable string.
<?php
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Related Products' :
$translated_text = __( 'Check out these related products', 'woocommerce' );
@jameskoster
jameskoster / functions.php
Created March 11, 2013 11:24
WooCommerce - Add new product tab
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
function woo_new_product_tab( $tabs ) {
// Adds the new tab
$tabs['test_tab'] = array(
'title' => __( 'New Product Tab', 'woocommerce' ),
'priority' => 50,
'callback' => 'woo_new_product_tab_content'
);