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
/** | |
* Set en_US lang code if not in admin. | |
*/ | |
function md_set_en_us_locale( $locale ) { | |
if ( ! is_admin() ) { | |
if ( ! defined( 'MD_REAL_LANG' ) ) | |
define( 'MD_REAL_LANG', $locale ); | |
$locale = 'en_US'; | |
} |
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
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |
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
// img unautop, Courtesy of Interconnectit http://interconnectit.com/2175/how-to-remove-p-tags-from-images-in-wordpress/ | |
// add img class and alignment to figure by @_RickBenetti | |
function img_unautop($pee) { | |
$class = apply_filters('get_image_tag_class', $class, $id, $align, $size); | |
$pee = preg_replace('/<p>\\s*?(<a .*?><img.*?><\\/a>|<img.*?>)?\\s*<\\/p>/s', '<figure class="'. $class+$align .'">$1</figure>', $pee); | |
return $pee; | |
} | |
add_filter( 'the_content', 'img_unautop', 30 ); |
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: Attachment Categories | |
Description: Allows attachments to be categorised | |
Version: 1.0 | |
Author: Human Made Limited | |
Author URI: http://hmn.md | |
*/ |
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
/* Elementar jQuery plugin [DRAFT] */ | |
// use Elementar fonts via Typotheque's web font system | |
// args: family name, style name, webfont key | |
$('.myClass').eFont('Sans A', '13 21 2', 'WF-XXXXXX-XXXXX') | |
// use self-hosted fonts | |
// args: family name, style name, path to fonts folder | |
$('.myClass').eFont('Sans A', '13 21 2', '../fonts/') |
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
<!DOCTYPE html> | |
<head> | |
<title>Stay Standalone</title> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
<script src="stay_standalone.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<ul> | |
<li><a href="http://google.com/">Remote Link (Google)</a></li> |
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 parseCSS(str) { | |
function trim(str) { | |
return (str||'').replace(/^\s\s*/, '').replace(/\s\s*$/, ''); | |
} | |
var i, j, k, | |
split = '}', | |
cur_key = '', | |
cur_key_split, | |
css = str.replace(/\t*/g, '').replace(/\s{2}/, ' ').replace(/[\n|\r]/g, ' ').replace(/\/\*.*?\*\//g, '').split(split), |
NewerOlder