Skip to content

Instantly share code, notes, and snippets.

View zanetaylor's full-sized avatar
👽

Zane Taylor zanetaylor

👽
View GitHub Profile
/* ********************
* Limit post excerpts. Within theme files used as
* print string_limit_words(get_the_excerpt(), 20);
******************************************************************** */
function string_limit_words($string, $word_limit) { $words = explode(' ', $string, ($word_limit + 1)); if(count($words) > $word_limit) array_pop($words); return implode(' ', $words); }
ul {
list-style: none;
li {
padding-left: 1em;
text-indent: -.7em;
}
li:before {
content: "\002022";
@zanetaylor
zanetaylor / caret.scss
Last active December 22, 2015 20:49
SASS caret mixin
@mixin caret($point, $border-width, $color) {
$opposite: opposite-position($point);
border: $border-width solid transparent;
border-#{$opposite}: $border-width solid $color;
border-#{$point}: 0;
height: 0;
width: 0;
}
@zanetaylor
zanetaylor / ie9-empty-transparent-hover-fix.css
Last active January 3, 2016 15:39
IE9 empty & transparent element :hover bug workaround
background: rgba(0, 0, 0, 0);
@zanetaylor
zanetaylor / Gruntfile.js
Created January 20, 2014 00:49
Gruntfile boilerplate for a basic Foundation 5 prototype
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Compiles Sass to CSS and generates necessary files if requested
compass: {
options: {
sassDir: 'app/assets/scss',
@zanetaylor
zanetaylor / vertical-align.css
Last active January 3, 2016 21:39
Vertical centering w/ pizazz!
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
@zanetaylor
zanetaylor / wp-enable-svg.php
Last active September 1, 2015 20:44
Enable SVG uploads in WordPress
add_filter('upload_mimes', 'custom_upload_mimes');
function custom_upload_mimes ( $existing_mimes=array() ) {
// add the file extension to the array
$existing_mimes['svg'] = 'mime/type';
// call the modified list of extensions
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
@zanetaylor
zanetaylor / keybase.md
Created June 21, 2016 21:18
Keybase proof

Keybase proof

I hereby claim:

  • I am zanetaylor on github.
  • I am zanetaylor (https://keybase.io/zanetaylor) on keybase.
  • I have a public key ASCFQjlTjdRWwgE3y4DnPcQcJkqotfgwpKNtZnperJcRygo

To claim this, I am signing this object:

<?php
/*
Template Name: Kitchen Sink
*/
get_header(); ?>
<div class="row">
<div class="small-12 large-12 columns" role="main">
<?php /* Start loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>