Skip to content

Instantly share code, notes, and snippets.

@lukecav
lukecav / functions.php
Created August 13, 2018 19:42
Generated password is based on the customers email address in WooCommerce
function wcs_filter_password_email( $args ) {
$args['user_pass'] = $args['user_email'];
return $args;
}
add_filter( 'woocommerce_new_customer_data', 'wcs_filter_password_email' );
@WPprodigy
WPprodigy / functions.php
Created February 7, 2018 04:02
Add Customer Notes column back to orders page.
<?php
add_filter( 'manage_shop_order_posts_columns', 'wc_define_columns', 15 );
function wc_define_columns( $columns ) {
$columns['customer_notes'] = __( 'Customer Notes', 'woocommerce' );
return $columns;
}
add_action( 'manage_shop_order_posts_custom_column', 'wc_render_customer_notes_column', 10, 2 );
function wc_render_customer_notes_column( $column, $post_id ) {
@hirejordansmith
hirejordansmith / better-woocommerce-cart-checkout-styles.css
Last active March 27, 2023 23:12
Better WooCommerce Cart and Checkout Styles
/* Woocommerce Styles */
/*
A couple things to note...
1. This code was written very specifically for my base child theme so it might not work out of the box with every theme.
I have it here mostly to share with anyone who might be looking to do the same thing I was.
2. I generally add my WooCommerce CSS overrides to a custom-woo.css file then use wp_enqueue_style() to call it
so that it enqueues after the default WooCommerce Stylesheets
@lumpysimon
lumpysimon / gist:5a68f561fd2381e64efe
Last active March 8, 2016 17:06
Example WordPress custom post type and taxonomy definitions using Extended CPTs and Extended Taxos
register_extended_post_type(
'newsletter',
array(
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => 45,
'quick_edit' => false,
'supports' => array( 'title', 'editor', 'thumbnail' ),
'admin_cols' => array(
'newsletter-image' => array(
@bacalj
bacalj / gist:18dac320b5d32b249207
Last active May 22, 2018 23:03
getting acf repeater into bootstrap tabs
<?php if (have_posts()) : while(have_posts()) :the_post();?>
<div class="post-single" id="post-<?php the_ID(); ?>">
<div class="post-body">
<!-- START CONTENT -->
<?php the_content();
//if there are tabs - open up a tabset ul
if( get_field('tab') ) {
echo ('<ul class="nav nav-tabs" role="tablist">');
@bekarice
bekarice / edit-woocommerce-checkout-template.php
Last active March 27, 2023 23:12
Add content and notices to the WooCommerce checkout - sample code
/**
* Each of these samples can be used - note that you should pick one rather than add them all.
*
* How to use WC notices: https://github.com/woothemes/woocommerce/blob/master/includes/wc-notice-functions.php#L96
* Tutorial: http://www.skyverge.com/blog/edit-woocommerce-templates/
**/
/**
* Add a content block after all notices, such as the login and coupon notices.
*
@lmartins
lmartins / gist:cdafd234879acf5e2160
Created October 8, 2014 07:45 — forked from corsonr/gist:7370707
WooCommerce - display order coupons used in confirmation email and edit order page
add_action( 'woocommerce_email_after_order_table', 'add_payment_method_to_admin_new_order', 15, 2 );
/**
* Add used coupons to the order confirmation email
*
*/
function add_payment_method_to_admin_new_order( $order, $is_admin_email ) {
if ( $is_admin_email ) {
@dlh01
dlh01 / WordPress parent and child themes with Sass, Compass, and Grunt.md
Last active March 17, 2023 11:57
Maintaining stylesheets for WordPress parent and child themes using Sass, Compass, and Grunt

This post outlines a way to use Sass, Compass, and Grunt to maintain stylesheets for a WordPress parent and child theme.

Sass is useful for many reasons, but for our purposes, the two most helpful features are partials and variables. We'll also take advantage of the importPath setting of Compass and Grunt.

Comments and improvements are always welcome.

Step 1: Create your parent stylesheet

Create a new Compass project in your theme and style away. When you're finished, your theme directory (called parent here) might look something like this:

@DrewAPicture
DrewAPicture / clean_404_emails.php
Last active September 27, 2023 09:03
Original snippet by wp-mix.com at http://wp-mix.com/wordpress-404-email-alerts/ With the improved OOP style, implementation is a lot more straightforward, just add <?php new Clean_404_Email; to the top of your 404.php template.
<?php
// Just require() this class via your theme's functions.php file.
/* Then instantiate this at the top of your 404.php file with:
if ( class_exists( 'Clean_404_Email' ) )
new Clean_404_Email;
*/
class Clean_404_Email {
var $time, $request, $blog, $email, $theme, $theme_data, $site, $referer, $string, $address, $remote, $agent, $message;
@malarkey
malarkey / Contract Killer 3.md
Last active May 8, 2024 16:02
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………