Skip to content

Instantly share code, notes, and snippets.

View mattie02's full-sized avatar

Matthew Hansen mattie02

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mattie02 on github.
  • I am mattie02 (https://keybase.io/mattie02) on keybase.
  • I have a public key whose fingerprint is 2AC3 D6A0 AC91 FA37 4F12 89F2 58D1 66A0 F981 E59D

To claim this, I am signing this object:

@mattie02
mattie02 / gist:8308341
Created January 7, 2014 22:45
only pull meta for specific page-template superCpt
if(class_exists( 'Super_Custom_Post_Type' )){
add_action( 'after_setup_theme','trusted_page_sup' );
function trusted_page_sup() {
if ( isset( $_GET['post'] ) )
$post_id = $_GET['post'];
elseif ( isset( $_POST['post_ID'] ) )
$post_id = $_POST['post_ID'];
else
$post_id = get_the_ID();
@mattie02
mattie02 / woocommerce-remove-virtual-billing-fields.php
Last active January 2, 2016 03:49 — forked from BFTrick/woocommerce-remove-virtual-billing-fields.php
For items that are downloadable and have a cost of zero only collects name / email / company
<?php
/**
* Plugin Name: WooCommerce Remove Billing Fields for Free Virtual Products
* Plugin URI: https://gist.github.com/BFTrick/7873168
* Description: Remove the billing address fields for free virtual orders
* Author: Patrick Rauland
* Author URI: http://patrickrauland.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
@mattie02
mattie02 / getWorkingDays.php
Last active August 29, 2015 14:27 — forked from quawn/getWorkingDays.php
PHP: GetWorkingDays excluding weekend and holidays
<?php
function getWorkingDays($startDate,$endDate,$holidays) {
// do strtotime calculations just once
$endDate = strtotime($endDate);
$startDate = strtotime($startDate);
//The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24
//We add one to inlude both dates in the interval.
$days = ($endDate - $startDate) / 86400 + 1;
@mattie02
mattie02 / child.js
Last active August 29, 2015 14:15 — forked from anonymous/child.js
.maps iframe{
pointer-events: none;
}
jQuery( document ).ready(function($) {
$('.maps').click(function () {
$('.maps iframe').css("pointer-events", "auto");
});
});
@mattie02
mattie02 / main.css
Last active August 29, 2015 14:11 — forked from anonymous/main.css
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
@mattie02
mattie02 / gist:9f84743685dcca9b7295
Created October 10, 2014 16:41
CPT in Shortcode
function resultsLoop($content = null) {
global $wp_query;
$temp = $wp_query;
$wp_query= null;
$mypost = array(
'post_type' => 'result',
'orderby' => 'menu_order',
'posts_per_page' => '-1',
'order' => 'ASC'
<?php
/* Add Image Upload to Series Taxonomy */
// Add Upload fields to "Add New Taxonomy" form
function add_series_image_field() {
// this will add the custom meta field to the add new term page
?>
<div class="form-field">
<label for="series_image"><?php _e( 'Series Image:', 'journey' ); ?></label>