Skip to content

Instantly share code, notes, and snippets.

View mommaroodles's full-sized avatar

Melanie Shepherd mommaroodles

View GitHub Profile
@mommaroodles
mommaroodles / expect-header-fix.php
Created March 11, 2021 04:04 — forked from carlalexander/expect-header-fix.php
WordPress "Expect" header fix
<?php
/**
* By default, cURL sends the "Expect" header all the time which severely impacts
* performance. Instead, we'll send it if the body is larger than 1 mb like
* Guzzle does.
*/
function add_expect_header(array $arguments)
{
$arguments['headers']['expect'] = !empty($arguments['body']) && strlen($arguments['body']) > 1048576 ? '100-Continue' : '';
@mommaroodles
mommaroodles / index.html
Created October 24, 2020 21:18
Infinite Scrolling Background
<section class="pen">
<div class="panel top">
<h1>Animate: background-position</h1>
</div>
<div class="panel bottom">
<h1>Animate: translate3d</h1>
<div class="scroll"></div>
</div>
</section>
@mommaroodles
mommaroodles / grid-flex-and-background-patterns.markdown
Created October 24, 2020 21:14
Grid, Flex, and background patterns
@mommaroodles
mommaroodles / index.pug
Created October 24, 2020 21:12
Pure CSS Particle Animation
.container
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/221808/sky.jpg").background
p.message all your dreams can come true<br>if you have the courage to pursue them
- for (i = 1; i <= 100; i++)
.circle-container
.circle
@mommaroodles
mommaroodles / index.html
Created October 24, 2020 21:03
Sliding Diagonals Background Effect
<div class="bg"></div>
<div class="bg bg2"></div>
<div class="bg bg3"></div>
<div class="content">
<h1>Sliding Diagonals Background Effect</h1>
</div>
@mommaroodles
mommaroodles / wp-config.php
Created October 24, 2020 10:52
wp-config.php
define('WP_HOME', 'http://www.example.com');
define('WP_SITEURL', 'http://www.example.com');`
define('FS_CHMOD_FILE', 0644);
define('FS_CHMOD_DIR', 0755); `
define( 'WP_DEBUG', false);
//define( 'WP_DEBUG_LOG', true );
//define( 'WP_DEBUG_DISPLAY', false );
@mommaroodles
mommaroodles / 1-remove-woocommerce-tabs.php
Created May 28, 2019 23:59 — forked from kittenlane/1-remove-woocommerce-tabs.php
Remove tabs but keep product description in WooCommerce
//* http://gasolicious.com/remove-tabs-keep-product-description-woocommerce/
// Location: add to functions.php
// Output: removes woocommerce tabs
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
@mommaroodles
mommaroodles / WooCommerce: Saved on Discount Amount and Percentage for Simple Products
Created May 23, 2019 16:56
WooCommerce: Saved on Discount Amount and Percentage for Simple Products
add_filter( 'woocommerce_get_price_html', 'bdev_display_sale_price_and_percentage_html', 10, 2 );
function bdev_display_sale_price_and_percentage_html( $price, $product ) {
// sale products on frontend excluding variable products
if( $product->is_on_sale() && ! is_admin() && $product->is_type('simple')) {
// product prices
$regular_price = (float) $product->get_regular_price();
$sale_price = (float) $product->get_price();
@mommaroodles
mommaroodles / functions.php
Created May 23, 2019 16:44
adds MSRP price to woocommerce admin and display
add_action( 'woocommerce_variation_options_pricing', 'bdev_add_variation_msrp', 11, 3 );
function bdev_add_variation_msrp( $loop, $variation_data, $variation ){
woocommerce_wp_text_input( array(
'id' => '_msrp_'.$loop,
'wrapper_class' => 'form-row form-row-first',
'class' => 'short wc_input_price',
'label' => __( 'RRP / MSRP', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ')',
'value' => str_replace('.', ',', get_post_meta($variation->ID, '_msrp', true)),
'data_type' => 'price',
) );
@mommaroodles
mommaroodles / functions.php
Created May 17, 2019 11:27 — forked from sharkyak/functions.php
woocommerce remove add to cart button
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
remove_action( 'woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30 );
remove_action( 'woocommerce_grouped_add_to_cart', 'woocommerce_grouped_add_to_cart', 30 );