Skip to content

Instantly share code, notes, and snippets.

@neilgee
neilgee / functions.php
Last active Aug 29, 2015 — forked from longjasonm/functions.php
Genesis Four Column Footer Widgets
View functions.php
<?php
//* Do NOT include the opening php tag
// Add support for 4-column footer widgets
add_theme_support( 'genesis-footer-widgets', 4 );
View string-body-class.php
<?php
function string_body_class($classes) {
if ( isset($_GET) && isset( $_GET['class'] ) ) :
$classes[] = sanitize_html_class( $_GET['class'] );
endif;
return $classes;
@neilgee
neilgee / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@neilgee
neilgee / header.php
Last active Sep 25, 2015 — forked from jameskoster/header.php
WooCommerce - Checkout link (when cart is not empty)
View header.php
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 / add-business-type-for-bp.php
Created May 5, 2016 — 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.
View add-business-type-for-bp.php
<?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 Oct 6, 2016 — forked from blogjunkie/functions.php
WooCommerce Genesis Connect + WooCommerce Sidebar
View functions.php
<?php //<~ don't add in
// Declare WooCommerce support for your theme
add_theme_support( 'woocommerce' );
@neilgee
neilgee / add_action.php
Created Jul 15, 2017 — forked from emilysnothere/add_action.php
Adding fields to the WordPress post submit box
View add_action.php
add_action('post_submitbox_misc_actions', createCustomField);
add_action('save_post', saveCustomField);
@neilgee
neilgee / function.php
Last active Aug 2, 2017 — forked from thewirelessguy/function.php
How to use Google's Organisation Logo Schema.org markup with WordPress Theme Logo
View function.php
function mytheme_setup() {
add_theme_support('custom-logo');
}
add_action('after_setup_theme', 'mytheme_setup');
@neilgee
neilgee / remove-password-strength.php
Last active Apr 25, 2018 — forked from WPprodigy/functions.php
Remove the password strength meter from WooCommerce checkout
View remove-password-strength.php
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 / gist:a8b8234ef720f988dae90db57046343a
Last active Dec 27, 2020 — 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/
View gist:a8b8234ef720f988dae90db57046343a
<?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');