This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ( $ ) { | |
/** | |
* A jQuery plugin that will position an element relative to another element, regardles of whether or not they share the | |
* same parent in the DOM. | |
* | |
* Note: This must be called within a $(document).ready() call to work properly. If loading images in the element | |
* that aren't specifically sized via CSS, it may be necessary to call this within a $(window).load() call | |
* depending on the positioning used. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function( $ ) { | |
/** | |
* A jQuery plugin that will toggle the display of an element when another element is clicked. | |
* When the toggled element is being displayed, clicking on the initiating element or any other element that | |
* is not the toggled element or its children will cause the toggled element to be hidden. | |
* | |
* @param $el | |
* @returns {*} | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.iosTapOut = function() { | |
return this.each( function() { | |
var $this = $(this); | |
var canTouch = 'ontouchstart' in document.documentElement; | |
if( canTouch ) { | |
$this.data( 'iosTapOut.active', false ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Helper function fetches current URL less the query string | |
* | |
* @return string | |
*/ | |
function get_url(){ | |
global $wp; | |
$url = parse_url( add_query_arg( $wp->query_string, '', home_url( $wp->request ) ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NameVirtualHost *:80 | |
<VirtualHost *:80> | |
ServerName dev | |
ServerAlias *.dev | |
VirtualDocumentRoot "/Users/home/Sites/%-2/public_html" | |
<Directory "/Users/home/Sites/"> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Order allow,deny |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Fetch the local date/time in WordPress based on a Unix timestamp. | |
* | |
* @param int $timestamp | |
* @param string $format | |
* @return string | |
*/ | |
function get_wp_local_date_time( $timestamp, $format = '' ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.content { | |
float: left; | |
margin-right: 300px; /* Must match sidebar width */ | |
padding-right: 20px; /* Gutter width */ | |
} | |
.sidebar { | |
float: right; | |
width: 300px; | |
margin-left: -100%; /* Won't work without this */ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_attribute_string(array $atts ) { | |
foreach( $atts as $key => &$value ) { | |
$value = "{$key}=\"{$value}\""; | |
} | |
return join( ' ' , $atts ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get a list of post types that support a specific feature. | |
* | |
* @param $feature | |
* @return array | |
*/ | |
function get_post_types_supporting( $feature ) { | |
global $_wp_post_type_features; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Recursively traverses a multidimensional array in search of a specific key and returns an | |
* array containing the keys that correspond to the path of the first found instance, or an | |
* empty array on failure. | |
*/ | |
function recursive_multidimensional_array_search_by_key( $key, array $data, $stack = array() ) { | |
if( array_key_exists( $key, $data ) ) { | |
array_push( $stack, $key ); |