Skip to content

Instantly share code, notes, and snippets.

View danielmcclure's full-sized avatar

Daniel McClure danielmcclure

View GitHub Profile
@spivurno
spivurno / gw-multi-page-navigation.php
Last active February 4, 2022 09:48
Gravity Wiz // Gravity Forms // Multi-page Form Navigation
<?php
/**
* Gravity Wiz // Gravity Forms // Multi-page Navigation
*
* Adds support for navigating between form pages by converting the page steps into page links or creating your own custom page links.
*
* @version 2.1
* @author David Smith <[email protected]>
* @license GPL-2.0+
* @link http://gravitywiz.com/multi-page-navigation/
@growdev
growdev / gist:5210074
Last active December 15, 2015 05:39
WooCommerce 2.0.4 - Change number of columns of thumbnails for Up Sells on product page.
<?php
// first remove the action defined in woocommerce-hooks.php
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
// modeled off of the woocommerce_upsell_display() function in woocommerce-template.php
// change $columns to desired number of columns
function my_woocommerce_upsell_display( $posts_per_page = '-1', $columns = 5, $orderby = 'rand' ) {
woocommerce_get_template( 'single-product/up-sells.php', array(
'posts_per_page' => $posts_per_page,
function add_genesis_before_entry () {
echo '<div class="before-entry">genesis_before_entry </div>';
};
add_action('genesis_before_entry ', 'add_genesis_before_entry ');
function add_genesis_entry_header () {
echo '<div class="entry-header">genesis_entry_header</div>';
@jgalea
jgalea / remove-billing.php
Last active June 9, 2020 19:58
Remove billing details from WooCommerce checkout.
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);
unset($fields['billing']['billing_city']);
unset($fields['billing']['billing_postcode']);
@agusmu
agusmu / style.css
Created July 10, 2013 00:46
WooCommerce - One Column Checkout
/* one column checkout page */
.woocommerce #customer_details.col2-set .col-1, .woocommerce-page #customer_details.col2-set .col-1,
.woocommerce #customer_details.col2-set .col-2, .woocommerce-page #customer_details.col2-set .col-2 {
clear: both;
float: none !important;
width: 100% !important;
margin-right:0 !important;
text-align: left;
padding-bottom: 20px;
}
@vajrasar
vajrasar / add_jetpack_infinite.php
Last active July 13, 2017 19:57 — forked from anonymous/add_jetpack_infinite.php
Steps to add Infinite Scroll (Jetpack) to a Genesis Child Theme running on Genesis 2.0 + HTML 5. Code goes in functions.php
<?php
/*
To add Infinite Loop Module provided in Jetpack wordpress Plugin, in Genesis driven site.
*/
/*
Step 1. Install Jetpack Plugin
*/
@salcode
salcode / gist:7164690
Last active May 12, 2017 22:12
Genesis WordPress Framework adding custom classes to markup This gist was originally created as an example of what I perceived to be an inconsistent behavior, my error was failing to attach my code to action `genesis_setup`. Corrected version now appears below. 20131027 - merged Gary Jones's fork with corrections and refactoring
<?php
/*
* Examples to add custom classes to Genesis WordPress Framework Markup when using HTML5 output
*/
add_action( 'genesis_setup', 'srf_add_cust_classes', 15 ); // Priority 15 ensures it runs after Genesis itself has setup.
function srf_add_cust_classes() {
add_filter( 'genesis_attr_site-inner', 'srf_attr_site_inner' );
add_filter( 'genesis_attr_content-sidebar-wrap', 'srf_attr_content_sidebar_wrap' );
add_filter( 'genesis_attr_content', 'srf_attr_content' );
add_filter( 'genesis_attr_sidebar-primary', 'srf_attr_sidebar_primary' );
@srikat
srikat / functions.php
Last active December 12, 2020 23:45
Adding a cart icon with number of items and total cost in nav menu when using WooCommerce. http://sridharkatakam.com/adding-cart-icon-number-items-total-cost-nav-menu-using-woocommerce/
//* Make Font Awesome available
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css' );
}
/**
* Place a cart icon with number of items and total cost in the menu bar.
@maxrice
maxrice / wc-rename-cart-coupon-field.php
Created January 21, 2014 23:53
WooCommerce - rename the "Apply Coupon" field on the cart page
<?php
// rename the coupon field on the cart page
function woocommerce_rename_coupon_field_on_cart( $translated_text, $text, $text_domain ) {
// bail if not modifying frontend woocommerce text
if ( is_admin() || 'woocommerce' !== $text_domain ) {
return $translated_text;
}
@maxrice
maxrice / wc-rename-checkout-coupon-field.php
Last active February 25, 2025 07:03
WooCommerce - rename the "Have a Coupon?" message and "Apply Coupon" field on the checkout
<?php
// rename the "Have a Coupon?" message on the checkout page
function woocommerce_rename_coupon_message_on_checkout() {
return 'Have a Promo Code?' . ' <a href="#" class="showcoupon">' . __( 'Click here to enter your code', 'woocommerce' ) . '</a>';
}
add_filter( 'woocommerce_checkout_coupon_message', 'woocommerce_rename_coupon_message_on_checkout' );
// rename the coupon field on the checkout page