This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
If you'd like to change an image or SVG to black set this styling on the <img> | |
This does not work on background-image. | |
example html | |
<figure><img src="icon.svg" /></figure> | |
*/ | |
figure img { | |
filter: invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2021 March | |
//Change "Telephone (Optional)" Text | |
function change_checkout_optional_text( $fields ) { | |
if( is_checkout() ) { | |
$fields['billing']['billing_phone']['required'] = 'hidden'; | |
$fields['billing']['billing_phone']['label'] = 'Telephone (We will only use this for delivery)'; | |
} | |
return $fields; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put this code in your (child) theme: | |
/* | |
* Mini cart with total count of items. | |
* This does not add the total amount of price. | |
* Do not put the hide on it by default, because that won't work. | |
* Leave it in the else statement. | |
*/ | |
add_filter( 'woocommerce_add_to_cart_fragments', 'add_to_cart_fragment', 10, 1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* because I keep forgetting and having to google it */ | |
window.onscroll=function(){ | |
console.log( | |
'top: ' + (window.pageYOffset || document.documentElement.scrollTop) + ' ' + | |
'left: ' + (window.pageXOffset || document.documentElement.scrollLeft) | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sendto = "email@email.com"; | |
$subject = "Email from Your Website"; | |
$name = $_POST['name']; | |
$email = $_POST['email']; | |
$project = $_POST['project']; | |
$message = $_POST['message']; | |
// Header | |
$headers = "From: Boo!" . strip_tags($usermail) . "\r\n"; | |
$headers .= "Reply-To: ". strip_tags($usermail) . "\r\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('init','delay_remove'); | |
function delay_remove() { | |
remove_action( 'woocommerce_after_shop_loop', 'woocommerce_catalog_ordering', 10 ); | |
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 ); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put this script in your functions.php | |
// I have very little pages, and I am sure it can be improved | |
// or adjusted to suit your own project. | |
//Deregister the scripts. | |
function deregister_contact_form() { | |
// You can put here all the pages where there is no contact form | |
if ( ! is_page( 'contact' ) ) { | |
remove_action('wp_enqueue_scripts', 'wpcf7_enqueue_scripts'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/questions/9546324/adding-directory-to-path-environment-variable-in-windows | |
// Paste this in your cmd terminal and replace [username] | |
// with your computer username. This is to tell your computer | |
// that your npm packages are in this directory. | |
set PATH=%PATH%; C:\Users\[username]\AppData\Roaming\npm |