Skip to content

Instantly share code, notes, and snippets.

@lumpysimon
lumpysimon / wp-remove-emoji.php
Created September 4, 2016 22:06
Remove WordPress emoji shit
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
@lumpysimon
lumpysimon / wp-stylesheet-loader.php
Last active January 10, 2017 09:52
WordPress cache-busting stylesheet loader
add_action( 'wp_enqueue_scripts', 'abc_styles' );
function abc_styles() {
wp_enqueue_style(
'abc',
get_stylesheet_uri(),
array(),
filemtime( get_template_directory() . '/style.css' )
);
var gulp = require('gulp'),
sass = require('gulp-sass'),
prefix = require('gulp-autoprefixer'),
sourcemaps = require('gulp-sourcemaps'),
livereload = require('gulp-livereload'),
input = {
'sass': [
'sass/**/*.scss'
]
@lumpysimon
lumpysimon / .lando.yml
Last active February 28, 2019 17:31
Lando config file for WordPress with Apache, PHP 7.2, Xdebug, MailHog and PHPMyAdmin
name: mysite
recipe: wordpress
config:
php: '7.2'
webroot: public
xdebug: true
conf:
php: .vscode/php.ini
proxy:
mailhog:
@lumpysimon
lumpysimon / .lando.yml
Last active October 9, 2020 22:08
Lando config file for WordPress with Nginx, PHP 7.2, MySQL 5.5, Xdebug, MailHog and PHPMyAdmin
name: mysite2
recipe: wordpress
config:
php: '7.2'
via: nginx
webroot: public
xdebug: true
conf:
php: .vscode/php.ini
proxy:
@lumpysimon
lumpysimon / .lando.yml
Created May 16, 2018 13:02
Lando config file for Kirby with Apache, PHP 7.2, SSL and MailHog
name: kirby
proxy:
appserver:
- kirby.lndo.site
mailhog:
- mail.kirby.lndo.site
services:
appserver:
type: php:7.2
via: apache
@lumpysimon
lumpysimon / vs-code-settings.json
Last active June 15, 2020 14:32
VS Code workplace settings with title bar colouring
{
"folders": [
{
"path": "/path/to/my/workspace/folder"
}
],
"settings": {
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#d12229",
"titleBar.activeForeground": "#ffffff",
@lumpysimon
lumpysimon / meta-tags.php
Last active July 10, 2018 14:10
Kirby meta tags config file
<?php
c::set('meta-tags.default', function(Page $page, Site $site) {
if ( $page->isErrorPage() )
return [
'title' => $page->title()
];
$title = ( $page->isHomePage() ? $site->title() : $page->title() . ' - ' . $site->title() );
@lumpysimon
lumpysimon / .htaccess
Last active August 1, 2018 15:35
.htaccess file for WordPress sites, with Strict Transport Security header and various caching improvements
Header always set Strict-Transport-Security "max-age=31536000" env=HTTPS
Header set X-Powered-By "WordPress and Lumpy Lemon"
AddDefaultCharset UTF-8
<IfModule mod_mime.c>
AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml
</IfModule>
<IfModule mod_headers.c>
@lumpysimon
lumpysimon / tiny-mce.php
Last active December 5, 2018 11:32
Configure the default WordPress TinyMCE behaviour, defaults and buttons
<?php
defined( 'ABSPATH' ) or die();
$lumpy_lemon_tiny_mce = new lumpy_lemon_tiny_mce;