Skip to content

Instantly share code, notes, and snippets.

View crondeau's full-sized avatar

Christine Rondeau crondeau

View GitHub Profile
@trepmal
trepmal / toggle-debug.php
Last active September 4, 2020 15:42
WordPress experiment. Toggle debug from admin bar
<?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);
}
@grappler
grappler / functions.php
Last active January 21, 2017 08:06
// add ie conditional html5 shim to header
<?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');
@mor10
mor10 / advanced-featured-image.php
Last active August 29, 2015 14:01
Advanced responsive featured image function utilizing transients for caching.
@tannerm
tannerm / functions.php
Last active August 29, 2015 13:57 — forked from flowdee/functions.php
<?php
/**
* Remove trailing parenthesis from youtube oembed
*
* @param $html
* @param $url
*
* @return mixed
*/
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* 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'),
@forgeandsmith
forgeandsmith / Gravity Forms Reset Styles
Last active June 22, 2021 07:33
Gravity Forms SCSS reset styles for easy style editing and management
///////////////////////////////////////////////
////// 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,
@jeherve
jeherve / functions.php
Last active October 10, 2016 13:48
[Jetpack] Customize the contents of the "Older Posts" text appearing when activating Infinite Scroll.
<?php
function jeherve_custom_infinite_more() {
if ( is_home() || is_archive() ) {
?>
<script type="text/javascript">
//<![CDATA[
infiniteScroll.settings.text = "Custom Text";
//]]>
</script>
@norcross
norcross / old-post-search-filter.php
Created July 23, 2012 14:50
filter search result to hide old posts
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;
}
@luetkemj
luetkemj / wp-query-ref.php
Last active May 25, 2024 10:56
WP: Query $args
// 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
*/
@garyharan
garyharan / _mixins.scss
Created May 5, 2011 15:46
Useful scss mixins (rounded corners, gradients, text-field, button)
@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;
}