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
{
"vars": {
"@gray-base": "#1e1e1e",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "#154e88",
"@brand-success": "#5cb85c",
@ewistrand
ewistrand / gist:e7c034d07216384bb622
Created November 5, 2015 17:09 — forked from mikejolley/gist:1597957
WooCommerce - Replace '' with 'Call for price' when price is left blank
/**
* This code should be added to functions.php of your theme
**/
add_filter('woocommerce_empty_price_html', 'custom_call_for_price');
function custom_call_for_price() {
return 'Call for price';
}
@ewistrand
ewistrand / config.rb
Created November 19, 2015 13:10 — forked from nathansmith/config.rb
Example config.rb file for Compass
preferred_syntax = :sass
http_path = '/'
css_dir = 'assets/stylesheets'
sass_dir = 'assets/sass'
images_dir = 'assets/images'
javascripts_dir = 'assets/javascripts'
relative_assets = true
line_comments = true
# output_style = :compressed
@ewistrand
ewistrand / wp-admin-thumbs.php
Last active November 19, 2015 13:31
Wordpress Admin Thumbnails
<?php
/**
* Add Thumbnails To Admin & size them to max at 200px
*/
add_filter('manage_posts_columns', 'posts_columns', 5);
add_action('manage_posts_custom_column', 'posts_custom_columns', 5, 2);
/**
* Add CPT Thumbs replace post-type with CPT, not neccesary if post thumbnails are supported for all types
*/
@ewistrand
ewistrand / wp-post-metabox.php
Last active November 19, 2015 13:34
WP Post Meta Box
<?php
/**
* Adds a box to the main column on the Post and Page edit screens.
*/
function myplugin_add_meta_box() {
$screens = array( 'post', 'page' );
foreach ( $screens as $screen ) {
@ewistrand
ewistrand / wp-remove-emoji-support.php
Created November 19, 2015 13:36
WP Remove Emoji Support
<?php
//Remove Emoji Support
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
?>
@ewistrand
ewistrand / wp-rss-thumbnails.php
Created November 19, 2015 13:45
WP RSS Thumbnails
<?php
// Add Thumbnail To RSS
function rss_post_thumbnail($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = '<p>' . get_the_post_thumbnail($post->ID) . '</p>' . get_the_content();
}
return $content;
}
add_filter('the_excerpt_rss', 'rss_post_thumbnail');
@ewistrand
ewistrand / wp-add-browser-classes.php
Created November 19, 2015 13:50
WP Add Browser Classes to body tag
<?php
// Add Browser To Body Class
add_filter('body_class','browser_body_class');
function browser_body_class($classes) {
global $is_lynx, $is_gecko, $is_IE, $is_opera,$is_NS4, $is_safari, $is_chrome, $is_iphone;
if($is_lynx) $classes[] = 'lynx';
elseif($is_gecko) $classes[] = 'gecko';
elseif($is_opera) $classes[] = 'opera';
@ewistrand
ewistrand / wp-post-id-column.php
Last active November 19, 2015 13:55
Create admin post and page id column in Wordpress admin
<?php
// Show Page Id In Admin panel
add_filter('manage_posts_columns', 'posts_columns_id', 5);
add_action('manage_posts_custom_column', 'posts_custom_id_columns', 5, 2);
add_filter('manage_pages_columns', 'posts_columns_id', 5);
add_action('manage_pages_custom_column', 'posts_custom_id_columns', 5, 2);
function posts_columns_id($defaults){
$defaults['wps_post_id'] = __('ID');
return $defaults;
@ewistrand
ewistrand / wp-widget-shortcodes.php
Created November 19, 2015 13:58
WP allow shortcodes in sidebar text widgets
<?php
/**
* Allow shortcodes in WP text widgets
*/
add_filter('widget_text', 'do_shortcode');
?>