This file contains 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 | |
/* | |
Plugin Name: Image P tag remover | |
Description: Plugin to remove p tags from around images and iframes in content outputting, after WP autop filter has added them. (oh the irony) | |
Version: 1.1 | |
Author: Fublo Ltd | |
Author URI: http://blog.fublo.net/2011/05/wordpress-p-tag-removal/ | |
*/ | |
function filter_ptags_on_images($content) |
This file contains 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 custom_field($key) { echo get_custom_field($key); } | |
function get_custom_field($key, $echo = FALSE) | |
{ | |
global $post; | |
$custom_field = get_post_meta($post->ID, $key, true); | |
if ($echo == FALSE) { return $custom_field; } | |
echo $custom_field; | |
} |
This file contains 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 | |
/* | |
Plugin Name: Disable plugins when doing local dev | |
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify | |
Version: 0.1 | |
License: GPL version 2 or any later version | |
Author: Mark Jaquith | |
Author URI: http://coveredwebservices.com/ | |
*/ |
This file contains 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
[alias] | |
s = status | |
st = stash | |
c = commit | |
ca = commit -a | |
a = add | |
rma = rm $(git ls-files --deleted) | |
b = branch | |
m = merge | |
f = fetch |
This file contains 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
// Switch out "DOMAIN" to be whatever the site domain is. | |
// | |
// ie. "colorjar" for http://colorjar.com | |
$.map($('a'), function(link){ | |
if (link.href.search(/.DOMAIN./) === -1){ | |
$(link).attr('target', '_blank'); | |
} | |
}); |
This file contains 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 neat_trim($str, $n, $delim='...') { | |
$len = strlen($str); | |
if ($len > $n) { | |
preg_match('/(.{' . $n . '}.*?)\b/', $str, $matches); | |
return rtrim($matches[1]) . $delim; | |
} | |
else { | |
return $str; | |
} | |
} |
This file contains 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
// ------------------------------ | |
// Form Input Placeholder | |
// ------------------------------ | |
if (!Modernizr.input.placeholder) | |
{ | |
$('input[placeholder], textarea[placeholder]').each(function(i, input){ | |
var $input = $(input); | |
// Initially load the placeholder value | |
if ($input.val() === '') { $input.val($input.attr('placeholder')); } |
This file contains 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
// iOS Media Queries | |
// Goal: capture styles for iPhone, iPhone 3G, iPhone 3GS, iPhone 4, iPhone 4S, iPad, and iPad 2 | |
// | |
// Author: Tony Schneider (@tonywok) | |
// Please tell me where I fail. :) | |
// iPhone v(4,4S) portrait | |
// test: black text (overwritten by v* portrait) with blue background | |
@media all and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait) { | |
a { |