Skip to content

Instantly share code, notes, and snippets.

@GaryJones
GaryJones / functions.php
Last active August 25, 2018 11:44
Conditionally add IE style sheets in WP
<?php
add_action( 'wp_print_styles', 'child_add_ie7_style_sheet', 200 );
/**
* Enqueue an IE-specific style sheet (for all browsers).
*
* @author Gary Jones
* @link https://garyjones.io/ie-conditional-style-sheets-wordpress
*/
function child_add_ie7_style_sheet() {
@bainternet
bainternet / DD32s-combine-plugin.php
Created February 11, 2012 17:06 — forked from mjc/DD32s-combine-plugin.php
WIP: Combine Javascript and CSS in wordpress
<?php
/*
Plugin Name: The Combiner
Plugin URI: http://dd32.id.au/wordpress-plugins/?plugin=combine-css-js
Description: Combine CSS & JS into one large monolithic file
Author: DD32
Version: 1.0
Author URI: http://dd32.id.au/
*/
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@Abban
Abban / WordPress Theme Customizer Sample.php
Created June 21, 2012 21:09
WordPress Theme Customizer Sample
<?php
function themename_customize_register($wp_customize){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('Color Scheme', 'themename'),
'priority' => 120,
));
// =============================
@milohuang
milohuang / f3-orbit-options.js
Created August 1, 2012 14:32 — forked from smileyj68/f3-orbit-options.js
Foundation 3 Orbit Options
$('#featured').orbit({
animation: 'fade', // fade, horizontal-slide, vertical-slide, horizontal-push
animationSpeed: 800, // how fast animtions are
timer: true, // true or false to have the timer
resetTimerOnClick: false, // true resets the timer instead of pausing slideshow progress
advanceSpeed: 4000, // if timer is enabled, time between transitions
pauseOnHover: false, // if you hover pauses the slider
startClockOnMouseOut: false, // if clock should start on MouseOut
startClockOnMouseOutAfter: 1000, // how long after MouseOut should the timer start again
directionalNav: true, // manual advancing directional navs
anonymous
anonymous / wp-breadcrumb-foundation
Created December 25, 2012 02:01
A function for adding breadcrumbs to a theme based on zurb's foundation framework. Based on: http://www.catswhocode.com/blog/how-to-breadcrumb-function-for-wordpress
function the_breadcrumb() {
if (!is_home()) {
echo '<ul class="breadcrumbs"><li><a href="';
echo get_option('home');
echo '">';
bloginfo('name');
echo "</a></li>";
if (is_category() || is_single()) {
the_category('<li>');
if (is_single()) {
@radiodario
radiodario / README.md
Last active December 8, 2016 08:04 — forked from dfm/LICENSE
Here's to a nice 2013

These are google searches for 'Old Lang Syne' since 2004. Seems to be popular around this time of the year.

@Shelob9
Shelob9 / foundation.min.js
Last active December 11, 2015 07:58
This is a minified version of all of the javascript for ZURB's Foundation except for jquery itself and app.js. I included all files I found in https://github.com/zurb/foundation/tree/master/vendor/assets/javascripts/foundation except for app.js, index.js and jquery.js
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-inlinesvg-svg-svgclippaths-touch-shiv-mq-cssclasses-teststyles-prefixes-ie8compat-load
*/
;window.Modernizr=function(a,b,c){function y(a){j.cssText=a}function z(a,b){return y(m.join(a+";")+(b||""))}function A(a,b){return typeof a===b}function B(a,b){return!!~(""+a).indexOf(b)}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:A(f,"function")?f.bind(d||b):f}return!1}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n={svg:"http://www.w3.org/2000/svg"},o={},p={},q={},r=[],s=r.slice,t,u=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style
@eduardozulian
eduardozulian / wp-customize-image-reloaded.php
Last active November 16, 2023 02:50
Extend WP_Customize_Image_Control class allowing access to files uploaded within the same context.
<?php
/**
* Customize Image Reloaded Class
*
* Extend WP_Customize_Image_Control allowing access to uploads made within
* the same context
*/
class My_Customize_Image_Reloaded_Control extends WP_Customize_Image_Control {
/**
* Constructor.
@gregrickaby
gregrickaby / _golden-ratio.scss
Last active August 28, 2023 14:31
Golden Ratio Typography for Sass
//
// Golden Ratio Typography
// --------------------------------------------------
// Golden Ratio Math
//
// Let's do some math so we can build beautiful typography and vertical rhythm.
// For any magic to happen, set the $ContentWidth variable on _variables.scss
// to match your content box width (normally this is 640px, 740px, etc...).