Skip to content

Instantly share code, notes, and snippets.

@westonruter
westonruter / wp-42573.php
Last active September 21, 2023 13:41
WP Trac #42573: Fix for theme template caching. https://core.trac.wordpress.org/ticket/42573
<?php
/**
* Plugin name: WP Trac #42573: Fix for theme template file caching.
* Description: Flush the theme file cache each time the admin screens are loaded which uses the file list.
* Plugin URI: https://core.trac.wordpress.org/ticket/42573
* Author: Weston Ruter, XWP.
* Author URI: https://weston.ruter.net
*/
function wp_42573_fix_template_caching( WP_Screen $current_screen ) {
@jdtdesigns
jdtdesigns / functions.php
Created December 24, 2015 02:23
Add current page slug to body class
function add_slug_body_class( $classes ) {
global $post;
if ( isset( $post ) ) {
$classes[] = $post->post_type . '-' . $post->post_name;
}
return $classes;
}
add_filter( 'body_class', 'add_slug_body_class' );
@awakekat
awakekat / wp-admin
Last active July 19, 2017 14:47
Custom wp-admin tweaks
/*
* Custom Tweaks
*/
define('WP_HOME', 'http://sitename.com'); // Lock settings of URL in Admin
define('AUTSAVE_INTERVAL', 120); // in seconds
define('WP_POST_REVISIONS', 4); // Max # of post revision history
define('EMPTY_TRASH_DAYS', 3); // # of days
define('DISALLOW_FILE_EDIT', true); // Lock out CSS in Admin
@salcode
salcode / .gitignore
Last active April 3, 2024 18:38
Please see https://salferrarello.com/wordpress-gitignore/ for the canonical version of this WordPress .gitignore file. Note: I do not receive notifications for comments here (because GitHub does not send notifications on Gists)
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20180808
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
@planetoftheweb
planetoftheweb / reload.html
Created February 20, 2014 05:15
Live Reload script for gulp.js
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
@chriskjaer
chriskjaer / gulpfile.js
Last active November 1, 2017 08:22
Gulp recipe: Jade, Sass, Livereload and static server
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
csso = require('gulp-csso'),
uglify = require('gulp-uglify'),
jade = require('gulp-jade'),
concat = require('gulp-concat'),
livereload = require('gulp-livereload'), // Livereload plugin needed: https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei
tinylr = require('tiny-lr'),
express = require('express'),
@cliftoncanady
cliftoncanady / fixed background image
Created November 6, 2013 04:24
CSS: fixed background
.title {
background: url(../image.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
padding: 8em 0; }
@iambibhas
iambibhas / scopes.txt
Last active April 8, 2024 20:37
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;