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: Toggle Debug | |
Description: Proof-of-concept for an admin-bar debug mode toggle. Needs some UX love. | |
*/ | |
/* | |
// In wp-config.php, wrap debug constants in a cookie conditional | |
if ( isset( $_COOKIE['wp-debug'] ) && $_COOKIE['wp-debug'] == 'on' ) { | |
define('WP_DEBUG', true); | |
} |
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 | |
// add ie conditional html5 shim to header | |
function _s_add_ie_html5_shim () { | |
echo '<!--[if lt IE 9]>'; | |
echo '<script src="' . get_template_directory_uri() . '/js/html5.js"></script>'; | |
echo '<![endif]-->'; | |
} | |
add_action('wp_head', '_s_add_ie_html5_shim'); |
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 for responsive featured images. | |
* Create a <picture> element and populate it with appropriate image sizes for different screen widths. | |
* Works in place of the_post_thumbnail(); | |
*/ | |
function simone_the_responsive_thumbnail($post_id) { | |
// Check to see if there is a transient available. If there is, use it. | |
if ( false === ( $thumb_data = get_transient( 'featured_image_' . $post_id ) ) ) { | |
simone_set_image_transient($post_id); |
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 | |
/** | |
* Remove trailing parenthesis from youtube oembed | |
* | |
* @param $html | |
* @param $url | |
* | |
* @return mixed | |
*/ |
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
/*! | |
* gulp | |
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev | |
*/ | |
// Load plugins | |
var gulp = require('gulp'), | |
sass = require('gulp-ruby-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
cssnano = require('gulp-cssnano'), |
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
/////////////////////////////////////////////// | |
////// GRAVITY FORMS RESET STYLES ////// | |
/////////////////////////////////////////////// | |
// These styles are made in mind to be used with SCSS or LESS | |
// If you use these styles, you must go to the Gravity Forms settings in the WordPress back end and set Output CSS to No. | |
////----- Core Containers | |
.gform_heading, | |
.gform_body, |
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 | |
function jeherve_custom_infinite_more() { | |
if ( is_home() || is_archive() ) { | |
?> | |
<script type="text/javascript"> | |
//<![CDATA[ | |
infiniteScroll.settings.text = "Custom Text"; | |
//]]> | |
</script> |
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 rkv_search_filter( $where = '' ) { | |
// don't touch anything outside of a search query | |
if(is_admin() || !is_search() ) | |
return $where; | |
// Hide posts older than 2 years old | |
if ( is_search() ){ | |
$where .= "AND post_type = 'post' AND post_date >= '" . date('Y-m-d', strtotime('-730 days')) . "'"; | |
return $where; | |
} |
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
@mixin box-shadow($top, $left, $blur, $color, $inset: false) { | |
@if $inset { | |
-webkit-box-shadow:inset $top $left $blur $color; | |
-moz-box-shadow:inset $top $left $blur $color; | |
box-shadow:inset $top $left $blur $color; | |
} @else { | |
-webkit-box-shadow: $top $left $blur $color; | |
-moz-box-shadow: $top $left $blur $color; | |
box-shadow: $top $left $blur $color; | |
} |
NewerOlder