Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View chrisvanpatten's full-sized avatar

Chris Van Patten chrisvanpatten

View GitHub Profile
@chrisvanpatten
chrisvanpatten / woocommerce-nags.php
Created April 23, 2015 16:38
Suppress WooCommerce nags
<?php
/**
* Suppress certain WooCommerce admin notices
*/
function suppress_woocommerce_nags() {
if ( class_exists( 'WC_Admin_Notices' ) ) {
// Remove the "you have outdated template files" nag
WC_Admin_Notices::remove_notice( 'template_files' );
@chrisvanpatten
chrisvanpatten / plugin.php
Created March 3, 2012 19:32
admin_enqueue_scripts
<?php
/**
*
* admin_enqueue_scripts is the preferred hook[1] for adding style to the admin, but
* documentation is frankly sparse and a bit confusing, especially for beginners.
*
* This gist has everything you need to load style for a plugin directly to a hook
* of your choice. Enjoy!
*
@chrisvanpatten
chrisvanpatten / wp-config.php
Created March 26, 2012 01:32
WordPress staging
<?php
//...
$urlParts = explode('.', $_SERVER['HTTP_HOST']);
if ($urlParts[0] == 'staging') {
// Do some stuff if we're on staging
define('WB_DEBUG', true);
// I want to rewrite the site_url and home_url here
@chrisvanpatten
chrisvanpatten / title-tag.php
Created April 1, 2012 23:00 — forked from nacin/title-tag.php
Replacement for wp_title()?
<?php
// In a theme:
add_action( 'after_setup_theme', function() {
add_theme_support( 'title-tag', array( 'option' => true ) );
} );
// In core:
add_action( 'wp_head', '_wp_render_title_tag' );
function _wp_render_title_tag() {
@chrisvanpatten
chrisvanpatten / index.php
Created April 20, 2012 17:48
Rach5 index file
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<?php get_template_part('head'); ?>
<body <?php body_class(); ?>>
<?php get_header(); ?>
@chrisvanpatten
chrisvanpatten / base.php
Created April 27, 2012 13:50
base.php example
<?php $base = theme_template_base(); ?><!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<?php get_template_part('head'); ?>
<body <?php body_class(); ?>>
<div id="wrap">
<div id="content-top"></div>
@chrisvanpatten
chrisvanpatten / README.md
Created May 7, 2012 19:01
Awesome CSS3 buttons with Compass and Sass

Awesome CSS3 buttons with Compass and Sass

This is a mixin I built for quick CSS3 buttons on the new VanPattenMedia.com. It's designed to be very flexible, and has a lot of options so you can customize it quickly and easily.

Documentation

Defaults are in bold, if they exist.

@include vpm-button($background-color, $text-color, $state, $spread, $radius);

get '/login' do
openid_user = get_user(params[:token])
user = User.first_or_create(
:identifier => '123456',
:email => 'chris@vanpattenmedia.com',
:nickname => 'Chris',
:photo_url => 'http://blah.com/cvp'
)
end
@chrisvanpatten
chrisvanpatten / wpframe-bootstrap.sh
Last active October 13, 2015 12:58
wpframe Bootstrap Script
#! /bin/bash
# wpframe Bootstrap Script
# This is really only a proof of concept. There are likely a lot of
# improvements that could be made to streamline this and accomplish
# things in fewer/faster steps.
#
# Please READ THE SCRIPT before you run it. I'm not responsible if
# you break something. Report any bugs and suggest improvements,
# please!
#
@chrisvanpatten
chrisvanpatten / _fonts.scss
Last active December 10, 2015 17:39
Fonts
/*
* Using Sass's @each loop to automatically generate code for web fonts
*/
$fonts: (vpm, font-awesome);
@each $font in $fonts {
@include font-face( $font,
font-files(
'#{$font}/#{$font}.woff',