Skip to content

Instantly share code, notes, and snippets.

View ewistrand's full-sized avatar
🦸‍♂️

Eric Wistrand ewistrand

🦸‍♂️
  • Truly Free
  • Traverse City Michigan
View GitHub Profile
@ewistrand
ewistrand / bs3-indicators.css
Created February 9, 2016 21:48
Bootstrap 3 Accordian Indicators
/* Accordian Indicators */
.panel-heading .accordion-toggle:before {
/* symbol for "opening" panels */
font-family: 'Glyphicons Halflings'; /* essential for enabling glyphicon */
content: "\e082"; /* adjust as needed, taken from bootstrap.css */
float: left; /* adjust as needed */
margin-right: 10px;
}
.panel-heading .accordion-toggle.collapsed:before {
/* symbol for "collapsed" panels */
@ewistrand
ewistrand / live.js
Created November 25, 2015 21:39
Livereload script
/*
Live.js - One script closer to Designing in the Browser
Written for Handcraft.com by Martin Kool (@mrtnkl).
Version 4.
Recent change: Made stylesheet and mimetype checks case insensitive.
http://livejs.com
http://livejs.com/license (MIT)
@livejs
@ewistrand
ewistrand / wp-custom-admin-footer.php
Created November 25, 2015 21:36
Wordpress custom admin footer text
@ewistrand
ewistrand / wp-breadcrumbs.php
Created November 25, 2015 21:09
Wordpress Breadcrumbs
function the_breadcrumb() {
global $post;
echo '<ul id="crumbs">';
if (!is_home()) {
echo '<li><a href="';
echo get_option('home');
echo '">';
echo 'Home';
echo "</a></li>";
if (is_category() || is_single()) {
@ewistrand
ewistrand / all-clients-add-contact.php
Created November 24, 2015 17:00
All Clients Add Contact
<?php
try {
/**
* AllClients Account ID and API Key.
*/
$account_id = esc_html( get_theme_mod( 'all_clients_id' ) );
$api_key = esc_html( get_theme_mod( 'all_clients_token' ) );
//print_r($options);
@ewistrand
ewistrand / wp-woocommerce-remove-elements.php
Created November 23, 2015 21:51 — forked from dompascal/wp-woocommerce-remove-elements.php
WP - WOOCOMMERCE - Remove Woocommerce Elements
/** woocommerce remove elements **/
remove_action( 'woocommerce_before_main_content','woocommerce_breadcrumb', 20, 0);
remove_action( 'woocommerce_before_shop_loop','woocommerce_result_count', 20, 0);
remove_action( 'woocommerce_before_shop_loop','woocommerce_catalog_ordering', 30, 0);
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
remove_action( 'woocommerce_after_single_product_summary','woocommerce_output_product_data_tabs', 10, 0);
@ewistrand
ewistrand / woo-disable-payment-require.php
Created November 23, 2015 21:48
Woocommerce disable requirement of payment
<?php
// woocommerce cart disable requirement of payment
add_filter('woocommerce_cart_needs_payment', '__return_false');
?>
@ewistrand
ewistrand / wp-default-custom-fields.php
Created November 19, 2015 14:57
WP Add default custom fields to posts
<?php
/**
* Add Default Custom Fields To Posts
* Note: This is just an example.
*/
add_action('wp_insert_post', 'set_default_custom_fields');
function set_default_custom_fields($post_id){
// slides can be post or any custom post type
if ( $_GET['post_type'] == 'slides' ) {
add_post_meta($post_id, 'subtitle', '', true);
@ewistrand
ewistrand / grid.scss
Created November 19, 2015 14:52
Simple SASS Grid
/* Grid Variables */
$grid-columns: 12;
$grid-max-width: 1920px;
/* Break Points */
$breakpoint-xs: "screen and (min-width: 320px)";
$breakpoint-ms: "screen and (min-width: 480px)";
$breakpoint-sm: "screen and (min-width: 768px)";
$breakpoint-md: "screen and (min-width: 1024px)";
$breakpoint-lg: "screen and (min-width: 1280px)";
@ewistrand
ewistrand / wp-custom-paginated-loop.php
Created November 19, 2015 14:49
Custom Wordpress loop with pagination
<?php
/**
* Create post loop query
*/
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'post',
'orderby' => 'menu_order',
'order' => 'ASC',
'showposts' => 3,