Skip to content

Instantly share code, notes, and snippets.

View WebEndevSnippets's full-sized avatar

Bruce Munson WebEndevSnippets

View GitHub Profile
@WebEndevSnippets
WebEndevSnippets / gist:6155359
Last active December 20, 2015 15:39
Soliloquy: Different Soliloquy Slider Each Day of Week (@garyj)
if ( function_exists( 'soliloquy_slider' ) ) {
$sliders = array(
'YOUR_SLIDER_ID_HERE', // Sunday
'YOUR_SLIDER_ID_HERE', // Monday
'YOUR_SLIDER_ID_HERE', // Tuesday
'YOUR_SLIDER_ID_HERE', // Wednesday
'YOUR_SLIDER_ID_HERE', // Thursday
'YOUR_SLIDER_ID_HERE', // Friday
'YOUR_SLIDER_ID_HERE', // Saturday
);
@WebEndevSnippets
WebEndevSnippets / width-adjust-functions.js
Created July 29, 2013 15:11
Run various JS stuff on widths (Norcross)
//********************************************************
// run size checks
//********************************************************
function between(x, min, max) {
return x >= min && x <= max;
}
//********************************************************
// now start the engine
@WebEndevSnippets
WebEndevSnippets / functions.php
Created July 25, 2013 15:45
WordPress: Redirect Page to HTTPS Secure (SSL)
add_action( 'template_redirect', 'webendev_secure_template_redirect', 1 );
/**
* Redirect Page to https scheme
*/
function webendev_secure_template_redirect() {
global $post;
if ( ( genesis_get_custom_field( 'wps_force_ssl' ) || is_page( 2048 ) ) && 'on' != $_SERVER['REDIRECT_HTTPS'] && 'on' != $_SERVER['HTTPS'] ) {
$post_data = get_post( $post->ID, ARRAY_A );
wp_redirect( site_url( $post_data['post_name'], 'https' ) );
@WebEndevSnippets
WebEndevSnippets / functions.php
Created June 28, 2013 17:14
Genesis: Change Featured Image Attributes
remove_filter( 'genesis_attr_entry-image', 'genesis_attributes_entry_image' );
add_filter( 'genesis_attr_entry-image', 'webendev_attributes_entry_image' );
/**
* Change Featured Image (Alignment)
*/
function webendev_attributes_entry_image( $attributes ) {
$attributes['class' ] = 'alignnone post-image entry-image';
$attributes['itemprop'] = 'image';
@WebEndevSnippets
WebEndevSnippets / functions.php
Created June 27, 2013 20:32
WordPress: Change Font in HTML Editor
add_action( 'admin_head-post.php', 'webendev_fix_html_editor_font' );
add_action( 'admin_head-post-new.php', 'webendev_fix_html_editor_font' );
/**
* Change Font in HTML Editor
*
*/
function webendev_fix_html_editor_font() { ?>
<style type="text/css">#wp-content-editor-container #content, #wp_mce_fullscreen { font-family: Verdana, Geneva, sans-serif; }</style>
<?php
}
@WebEndevSnippets
WebEndevSnippets / functions.php
Created June 14, 2013 13:48
Genesis: Add Breadcrumbs to Select Pages
add_action( 'genesis_before', 'webendev_add_breadcrumbs' );
/**
* Add Breadcrumbs to Select Pages
*/
function webendev_add_breadcrumbs() {
if( ! is_page( 793 ) ) {
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
}
}
@WebEndevSnippets
WebEndevSnippets / functions.php
Created June 13, 2013 20:08
Plugin: WooCommerce - Set Virtual Order Status to Complete After Payment
add_filter( 'woocommerce_payment_complete_order_status', 'webendev_virtual_order_payment_complete_order_status', 10, 2 );
/**
* WooCommerce - Set Virtual Order Status to Complete After Payment
* http://www.skyverge.com/blog/how-to-set-woocommerce-virtual-order-status-to-complete-after-payment/
*
*/
function webendev_virtual_order_payment_complete_order_status( $order_status, $order_id ) {
$order = new WC_Order( $order_id );
if ( 'processing' == $order_status &&
@WebEndevSnippets
WebEndevSnippets / functions.php
Created June 12, 2013 15:58
Plugin: Conditionally Load TablePress Plugin CSS
/**
* Conditionally Load TablePress Plugin CSS
*
*/
add_filter( 'tablepress_use_default_css', 'we_remove_tablepress_default_css' );
function we_remove_tablepress_default_css() {
if ( ! is_front_page() ) {
return true;
}
return false;
@WebEndevSnippets
WebEndevSnippets / lazy-load.php
Created June 12, 2013 13:05
Plugin: Do not load Lazy Load JS on Front Page
if ( is_front_page() ) // *************** WebEndev MOD to not load JS on Front Page ******************
return;
@WebEndevSnippets
WebEndevSnippets / cart.php
Last active April 19, 2018 15:21
Plugin: Clear Cart for WooCommerce
<input type="submit" class="button" name="clear-cart" value="<?php _e('Empty Cart', 'woocommerce'); ?>" />