This file contains hidden or 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
| #!/bin/zsh | |
| # WordPress Local Development Symlink Helper | |
| # | |
| # This script automates the process of: | |
| # 1. Creating project folder structure | |
| # 2. Cloning WordPress themes/plugins from GitHub | |
| # 3. Creating symlinks to Local by Flywheel installations | |
| # | |
| # CONFIGURATION REQUIRED: |
This file contains hidden or 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
| // netlify/functions/receive-email.js | |
| const { simpleParser } = require("mailparser"); | |
| const fs = require("fs"); | |
| const path = require("path"); | |
| exports.handler = async function (event) { | |
| if (event.httpMethod !== "POST") { | |
| return { statusCode: 405, body: "Method Not Allowed" }; | |
| } |
This file contains hidden or 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
| const childProcess = require('child_process'); | |
| // Add this to .eleventy.js file | |
| eleventyConfig.addShortcode('lastCommitDate', function () { | |
| const lastUpdatedFromGit = childProcess.execSync(`git log -1 --format=%cd --date=short`).toString().trim(); | |
| const formattedDate = DateTime.fromISO(lastUpdatedFromGit).toLocaleString(DateTime.DATETIME_HUGE); | |
| return formattedDate; | |
| }); | |
| // reference post: magaliechetrit.com |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 protected]"; | |
| $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 hidden or 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 hidden or 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'); | |
| } |
NewerOlder