Skip to content

Instantly share code, notes, and snippets.

@neilgee
neilgee / filter-wc-orders-by-gateway.php
Created January 13, 2021 21:55 — forked from bekarice/filter-wc-orders-by-gateway.php
Filters WooCommerce Orders by Payment Gateway Used
<?php
/**
* Plugin Name: Filter WooCommerce Orders by Payment Method
* Plugin URI: http://skyverge.com/
* Description: Filters WooCommerce orders by the payment method used :)
* Author: SkyVerge
* Author URI: http://www.skyverge.com/
* Version: 1.0.0
* Text Domain: wc-filter-orders-by-payment
*
@neilgee
neilgee / gist:a8b8234ef720f988dae90db57046343a
Last active December 27, 2020 23:34 — forked from webaware/gist:6260468
WooCommerce purchase page add-to-cart with quantity and AJAX, without customising any templates. See blog post for details: http://snippets.webaware.com.au/snippets/woocommerce-add-to-cart-with-quantity-and-ajax/
<?php
/**
* start the customisation
*/
function custom_woo_before_shop_link() {
add_filter('woocommerce_loop_add_to_cart_link', 'custom_woo_loop_add_to_cart_link', 10, 2);
add_action('woocommerce_after_shop_loop', 'custom_woo_after_shop_loop');
}
add_action('woocommerce_before_shop_loop', 'custom_woo_before_shop_link');
@neilgee
neilgee / function.php
Last active August 2, 2017 23:28 — forked from alana-mullen/function.php
How to use Google's Organisation Logo Schema.org markup with WordPress Theme Logo
function mytheme_setup() {
add_theme_support('custom-logo');
}
add_action('after_setup_theme', 'mytheme_setup');
@neilgee
neilgee / add_action.php
Created July 15, 2017 07:51 — forked from emilysnothere/add_action.php
Adding fields to the WordPress post submit box
add_action('post_submitbox_misc_actions', createCustomField);
add_action('save_post', saveCustomField);
@neilgee
neilgee / remove-password-strength.php
Last active March 15, 2023 11:51 — forked from WPprodigy/functions.php
Remove the password strength meter from WooCommerce checkout
add_action( 'wp_print_scripts', 'themeprefix_remove_password_strength', 100 );
// Remove password strength script
function themeprefix_remove_password_strength() {
if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) {
wp_dequeue_script( 'wc-password-strength-meter' );
}
}
@neilgee
neilgee / add-business-type-for-bp.php
Created May 5, 2016 04:31 — forked from NateWr/add-business-type-for-bp.php
Modifies the Business Profile plugin to include a new business type option from the Schema.org collection.
<?php
/**
* Plugin Name: Add Business Type Option for Business Profile
* Plugin URI: http://themeofthecrop.com
* Description: Modifies the Business Profile plugin to include a new business type option from the Schema.org collection.
* Version: 0.0.1
* Author: Theme of the Crop
* Author URI: http://themeofthecrop.com
* License: GNU General Public License v2.0 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
@neilgee
neilgee / functions.php
Last active October 6, 2016 01:56 — forked from blogjunkie/functions.php
WooCommerce Genesis Connect + WooCommerce Sidebar
<?php //<~ don't add in
// Declare WooCommerce support for your theme
add_theme_support( 'woocommerce' );
@neilgee
neilgee / header.php
Last active September 25, 2015 00:18 — forked from jameskoster/header.php
WooCommerce - Checkout link (when cart is not empty)
global $woocommerce;
if ( sizeof( $woocommerce->cart->cart_contents) > 0 && !is_cart() && !is_checkout() ) :
echo '<a href="' . $woocommerce->cart->get_checkout_url() . '" title="' . __( 'Checkout' ) . '">' . __( 'Checkout' ) . '</a>';
endif;
@neilgee
neilgee / 0_reuse_code.js
Last active August 29, 2015 14:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
function string_body_class($classes) {
if ( isset($_GET) && isset( $_GET['class'] ) ) :
$classes[] = sanitize_html_class( $_GET['class'] );
endif;
return $classes;