Skip to content

Instantly share code, notes, and snippets.

View jongamble's full-sized avatar

Jon Gamble jongamble

View GitHub Profile
<?php // Let's make a trail of crumbs, whether we are on the post or the page....This DOES NOT support custom Post Types...
function get_breadcrumbs($post){
//Create an is_blog function
function is_blog($post) {
$posttype = get_post_type($post);
return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ;
}
$bread_crumb_trail = '<span><a href="'.get_bloginfo('url').'">Home</a></span> &raquo;';
//Ancestors will only live on hierarchical posts...just pages.
@jongamble
jongamble / gist:5065114
Created March 1, 2013 14:48
Minimal header slider
//Header image slider
function remCla( elemLen ){
$(".pager li").removeClass().eq(elemLen).addClass("active");
}
var i = 0;
function InOut( elem ){
elem.delay().fadeIn().delay(7000).fadeOut(800,
function(){
i+=1;
i%=3;
@jongamble
jongamble / geocode.py
Last active December 12, 2015 08:09
Geocoding addresses from a CSV file and outputting to a json file
#!/usr/bin/python
# Filename: geocoding.py
import csv
from geopy import geocoders
import time
g = geocoders.Google()
spamReader = csv.reader(open('fileName.csv', 'rbU'), quotechar='|')
@jongamble
jongamble / insertTermsFront
Created February 8, 2013 16:01
Wordpress insert terms function
<?php
$terms = array(
'Birmingham - AL',
'Dothan - AL',
'Huntsville - AL',
'Montgomery - AL',
'Mobile - AL',
'Anchorage - AK',
'Fairbanks - AK',
'Juneau - AK',