Skip to content

Instantly share code, notes, and snippets.

View JakeHenshall's full-sized avatar
🏊
Wild Swimming

Jake Henshall JakeHenshall

🏊
Wild Swimming
View GitHub Profile
@JakeHenshall
JakeHenshall / breadcrumbs
Last active August 29, 2015 14:04
Beautiful Breadcrumbs
<?php
function breadcrumbs($separator = ' > ', $home = 'Home') {
$path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));
$base_url = substr($_SERVER['SERVER_PROTOCOL'], 0, strpos($_SERVER['SERVER_PROTOCOL'], '/')) . '://' . $_SERVER['HTTP_HOST'] . '/';
$breadcrumbs = array("<a href=\"$base_url\">$home</a>");
$tmp = array_keys($path);
$last = end($tmp);
unset($tmp);
@JakeHenshall
JakeHenshall / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
/**
* Kirki Sass Compiler
*
* Create a CSS file based on a SCSS-file and Kirki variables
* File gets saved in the public folder with a cache buster.
*/
namespace App\Kirki;
use Leafo\ScssPhp\Compiler;
@JakeHenshall
JakeHenshall / changelog.php
Created February 4, 2018 16:11
AFC repeater values from custom post type returned as a number not text
<?php
/**
* Template Name: Changelog
*/
$context = Timber::get_context();
$post = Timber::get_post();