Skip to content

Instantly share code, notes, and snippets.

View ebinnion's full-sized avatar

Eric Binnion ebinnion

View GitHub Profile
@ebinnion
ebinnion / slideshow.php
Last active August 29, 2015 14:01
Crane|WEST Slideshow CPT Snippet with Aqua Resizer
<?php
$slides = new WP_Query(
array(
'post_type' => 'slideshow',
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'asc',
)
);
<?php
/**
* Plugin Name: Multiple Roles per User
* Description: Allows anyone who can edit users to set multiple roles per user. In a default WordPress environment that wouldn't have much of an effect, since the user would have the privileges of the top-privileged role that you assign to him. But if you have custom roles with custom privileges, this might be helpful.
* Version: 1
* Author: nikolov.tmw
* Author URI: http://paiyakdev.com/
* License: GPL2
*/
/*
<?php
$listings = array(
array(
'address' => '3410 Taft Blvd',
'city' => 'Wichita Falls',
'state' => 'Tx',
'zip' => 76308
)
);
@ebinnion
ebinnion / functions.php
Created May 12, 2014 06:41
A method to enqueue and auto version CSS and JavaScript in WordPress.
<?php
/**
* Auto-versioning CSS and JavaScript in WordPress
* @author Eric Binnion
* http://manofhustle.com
*/
add_action("wp_enqueue_scripts", "auto_version_scripts", 20);
function auto_version_scripts() {
// Get last modified timestamp of CSS file in /css/style.css
@ebinnion
ebinnion / wp_engine_max_cdn.txt
Last active August 29, 2015 14:01
WP Engine to Max CDN integration. This is added to the WP Engine tab of the WordPress admin. Relies on pull zone being set up on Max CDN and Cnames added correctly.
#http:\/\/manofhustle.com\/(\S*\.(?:jpe?g|png|gif|ttf|otf|svg|woff|xml))# => http://cdn.manofhustle.com/$1
#http:\/\/manofhustle.com\/(\S*js)# => http://js.manofhustle.com/$1
#http:\/\/manofhustle.com\/(\S*css)# => http://css.manofhustle.com/$1
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@ebinnion
ebinnion / .bash_profile
Last active August 29, 2015 14:00
Gist of helpful commands that I use in development.
PATH=$PATH:~/bin
export PATH
alias ll='ls -lah'
# Git aliases
alias softreset='git reset --soft HEAD^'
alias hardreset='git reset --hard HEAD^'
# Following http://viget.com/inspire/terminal-aliases-for-git
<?php
/* From https://www.usps.com/send/official-abbreviations.htm */
$us_state_abbrevs_names = array(
'AL'=>'ALABAMA',
'AK'=>'ALASKA',
'AS'=>'AMERICAN SAMOA',
'AZ'=>'ARIZONA',
'AR'=>'ARKANSAS',
<?php
function foundation_pagination() {
global $wp_query;
$big = 999999999;
$links = paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: {
sourceComments: 'map',
includePaths: require('node-bourbon').includePaths,