Skip to content

Instantly share code, notes, and snippets.

View DevinWalker's full-sized avatar
🌱
Coding for good

Devin Walker DevinWalker

🌱
Coding for good
View GitHub Profile
@DevinWalker
DevinWalker / gravity-forms-roots.css
Created June 7, 2013 22:35
Gravity Forms Basic Styles for Responsive Sites using Roots Theme
/* Gravity Forms General */
.gform_fields { padding: 0; margin: 0 0 10px; }
#main .gform_fields { margin: 20px 0; }
.gform_fields li, #main .gform_fields li { list-style-type: none; padding: 0; margin: 0 0 15px; }
select { background: #fbfbfb; }
@DevinWalker
DevinWalker / 0_reuse_code.js
Created December 23, 2013 07:03
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
/**
* 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, 3);
add_action('woocommerce_after_shop_loop', 'custom_woo_after_shop_loop');
}
add_action('woocommerce_before_shop_loop', 'custom_woo_before_shop_link');
@DevinWalker
DevinWalker / give-literal-gateway-labels.php
Created January 14, 2016 02:18
Call the Gateway by it's name; primarily used for testing purposes
/**
* Call Give Payment Gateways by Name
*
* @param $gateways
*
* @return mixed
*/
function gr_override_gateway_labels( $gateways ) {
$gateways['authorize']['checkout_label'] = 'Authorize';
$gateways['stripe']['checkout_label'] = 'Stripe';
@DevinWalker
DevinWalker / layerslider-conditional.php
Created November 21, 2013 19:12
Load LayerSlider scripts/styles only when a shortcode is present in the content (can be modified to custom meta, etc).
<?php
/**
* Load LayerSlider Scripts only when shortcode is present
*
* Deregister Scripts from LayerSlider if no shortcode in content
* Using do_shortcode function? See: http://wordpress.stackexchange.com/questions/20854/conditionally-loading-javascript-css-for-shortcodes/75915#75915
*/
function check_for_layerslider_shortcode() {
global $post;
@DevinWalker
DevinWalker / custom-donation-total-label.php
Last active December 23, 2016 20:36
Customized the Give donation total label globally
/**
* Give Custom Donation Total Label
*
* @return string|void
*/
function my123_custom_donation_total_label(){
return __('My Custom Label', 'my_textdomain');
}
@DevinWalker
DevinWalker / woocommerce-vitual-mark-complete.php
Created April 6, 2013 07:49
WooCommerce Mark Virtual Orders as Complete
//Mark Virtual Orders as Complete
add_filter( 'woocommerce_payment_complete_order_status', 'virtual_order_payment_complete_order_status', 10, 2 );
function virtual_order_payment_complete_order_status( $order_status, $order_id ) {
$order = new WC_Order( $order_id );
if ( $order_status == 'processing' &&
( $order->status == 'on-hold' || $order->status == 'pending' || $order->status == 'failed' ) ) {
$virtual_order = true;
/* Basic form style cleanup */
ul#give-donation-level-radio-list {
list-style: none;
padding: 0;
}
ul#give-donation-level-radio-list input {
margin: 0 5px 0 3px;
}
@DevinWalker
DevinWalker / base-typography.css
Created May 13, 2014 18:28
Nice set of base styles for WordPress Blank themes and Roots theme
/*-----------------------------------------
Typography
--------------------------------------------*/
img.alignleft, img.alignright, img.alignnone {
border-radius: 0;
border: none;
}
@DevinWalker
DevinWalker / functions.php
Last active May 13, 2017 16:11 — forked from dougedgington/functions.php
WooCommerce force SSL entire shop
<?php
/*
Author: Doug Edgington
Description: modified version of Woocomemrce SSL functionality, forces ssl on Woocommerce pages and two additional custom pages
*/
function dee_ssl_template_redirect() {
if ( ! is_ssl() ) {
if ( is_checkout() || is_account_page() || is_woocommerce() ) {