Skip to content

Instantly share code, notes, and snippets.

View colegeissinger's full-sized avatar

Brainfestation colegeissinger

View GitHub Profile
function make_author_bio() {
global $post;
// Get our author meta
$author_id = $post->post_author;
$author = get_userdata( $author_id );
$url = 'http://en.gravatar.com/' . $author->data->user_login . '.json';
$contents = wpcom_vip_file_get_contents( $url );
//echo '<pre>'; print_r( $author ); echo '</pre>';
@colegeissinger
colegeissinger / import-csv-makerfaire.php
Last active December 17, 2015 03:09
Read a CSV file and export it to an importable XML file for WordPress. Code is setup to import "exhibits" for Maker Faire.
<?php
/**
* Allows us to convert CSV/Spread Sheets and generate an XML file for the import of WordPress.
*
* Save this file into the root of your WordPress install to run. Other wise, modify the file path for the wp-load.php.
*
* EG. Use this URL to generate the XML. Or use cURL to save the file.
* http://localhost/import-csv-makerfaire.php?file_name=BazBizMF13_Vendor-IMPORT.csv&url=http://localhost/imports/
* curl "http://localhost/import-csv-makerfaire.php?file_name=BazBizMF13_Vendor-IMPORT.csv&url=http://localhost/imports/" -o "makerfaire-exibit-import.xml"
@colegeissinger
colegeissinger / gist:5146253
Created March 12, 2013 19:37
Use this to load the WP Bootstrap anywhere. Of course, if you aren't loading this into multiple scripts, just use the code inside the function and paste it directly into your PHP script.
function load_wp_bootstrap() {
// Traverse the directory back to the root of the WordPress install.
// Adding a dirname() will go back one directory (equivilent to ../).
$root = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) );
// Load the WordPress Bootstrap
if ( file_exists( $root . '/wp-load.php' ) ) require_once( $root . '/wp-load.php' );
}
@colegeissinger
colegeissinger / wptuts-upload-3.5-ready.js
Last active April 2, 2018 14:32
Integrating the WP Media Uploader, version 3.5, Into Your Theme With jQuery. Based off the original tut found on http://wp.tutsplus.com/tutorials/creative-coding/integrating-the-wp-media-uploader-into-your-theme-with-jquery/ But updated to use the 3.5 Media Uploader. While I'm not the biggest JavaScript nerd out there, I understand enough to get…
(function($) {
$(function() {
$.fn.wptuts = function(options) {
var selector = $(this).selector; // Get the selector
// Set default options
var defaults = {
'preview' : '.preview-upload',
'text' : '.text-upload',
'button' : '.button-upload',
};
@colegeissinger
colegeissinger / script.js
Last active December 12, 2015 07:59
A response to @whyisjake about simplify some JavaScript in a Gist found here https://gist.github.com/whyisjake/4736577. View this on Codepen http://codepen.io/colegeissinger/pen/qdvGB
jQuery(document).ready(function(){
jQuery('#tabs li').click(function() {
id = $(this).attr('id');
//alert(id);
$('#steps div#js-' + id).slideDown();
$('#steps div:not(#js-' + id + ')').slideUp();
});
});
a:5:{i:0;O:8:"stdClass":5:{s:5:"title";s:50:"Install the standpipe and underground drain pipe.";s:5:"lines";a:2:{i:0;O:8:"stdClass":4:{s:4:"text";s:408:"My design uses a 2&quot; ABS standpipe that runs down from the washer and connects to a gently sloping horizontal pipe buried under a garden path. At the other end, the water splits and travels a bit farther in 2 directions, then flows out through perforated pots and bark chip mulch, and into the soil beneath some water-loving plants and trees. The area to be watered was 40' away and 10' below the washer.";s:8:"text_raw";s:403:"My design uses a 2" ABS standpipe that runs down from the washer and connects to a gently sloping horizontal pipe buried under a garden path. At the other end, the water splits and travels a bit farther in 2 directions, then flows out through perforated pots and bark chip mulch, and into the soil beneath some water-loving plants and trees. The area to be watered was 40' away and 10' below the washer.";s:6:"bullet";s:5:"black";s:5:"lev
@colegeissinger
colegeissinger / Fancy CSS3 Box Shadows with SCSS
Created February 7, 2013 09:03
Fancy CSS3 Box Shadows with SCSS. Requires SASS and Compass to be installed.
// Import some requiredness from compass
@import "compass/reset";
@import "compass/css3/box-shadow";
@import "compass/css3/transform";
// Define our mixin
@mixin fancy-box-shadow($color:rgba(0,0,0,.5), $left_shadow:-4deg, $right_shadow:4deg, $bottom:8px) {
position:relative;
background:#fff;