Skip to content

Instantly share code, notes, and snippets.

@lumpysimon
lumpysimon / gist:5a68f561fd2381e64efe
Last active Mar 8, 2016
Example WordPress custom post type and taxonomy definitions using Extended CPTs and Extended Taxos
View gist:5a68f561fd2381e64efe
register_extended_post_type(
'newsletter',
array(
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => 45,
'quick_edit' => false,
'supports' => array( 'title', 'editor', 'thumbnail' ),
'admin_cols' => array(
'newsletter-image' => array(
@lumpysimon
lumpysimon / gist:2942fa7d71859c35f566
Created Oct 1, 2014
Better XML Sitemaps (WordPress plugin): set cache folder and exclude pages
View gist:2942fa7d71859c35f566
<?php
defined( 'ABSPATH' ) or die();
$ll_sitemap = new ll_sitemap;
@lumpysimon
lumpysimon / lumpy-responsive-columns.htm
Created Jun 18, 2014
Responsive columns HTML markup
View lumpy-responsive-columns.htm
<section class="cols">
<div class="col col-3-5">
<div class="cols">
<div class="col col-1-3">
<div class="button">one third of three fifths</div>
</div>
<div class="col col-1-3">
<div class="button">one third of three fifths</div>
</div>
<div class="col col-1-3">
View lumpy-responsive-columns.scss
/*
===========
= columns =
===========
*/
$gutter: 4%;
@lumpysimon
lumpysimon / .gitignore
Last active Jun 14, 2021
A .gitignore file for WordPress that ignores pretty much everything except for the specified plugin(s), theme(s) and mu-plugins folder
View .gitignore
# .gitignore file for WordPress that ignores everything except:
#
# - .gitignore
# - favicon.ico
# - wp-config.php
# - everything in mu-plugins
# - my-plugin
# - my-theme (except for .sass-cache)
#
# based on https://gist.github.com/jdbartlett/444295
@lumpysimon
lumpysimon / WordPress Webkit Line Height Fixer
Last active Aug 29, 2015
Quick n dirty fix to strip out the line height styles inserted by Webkit browsers when saving posts in WordPress.
View WordPress Webkit Line Height Fixer
<?php
/*
Plugin Name: Webkit Line Height Fixer
Plugin URI: https://twitter.com/lumpysimon
Description: Remove the annoying inline line-height styles added by Webkit
Version: 1.0
Author: Simon Blackbourn @ Lumpy Lemon
Author URI: http://lumpylemon.co.uk
View gist:5583782
$trace=debug_backtrace();
$caller=array_shift($trace);
error_log( "Lumpy: mail debug function " . print_r( $trace[0]['function'] , true ) );
error_log( "Lumpy: mail debug class " . print_r( $caller['class'] , true ) );
@lumpysimon
lumpysimon / gist:5212084
Last active Dec 15, 2015 — forked from twosixcode/gist:1988097
Sublime Text key binding: swap paste & paste-and-indent (put in Preferences -> Key Bindings - User)
View gist:5212084
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
@lumpysimon
lumpysimon / Lumpy function.sublime-snippet
Created Mar 21, 2013
Sublime Text snippet: PHP function with arg & default
View Lumpy function.sublime-snippet
<snippet>
<content><![CDATA[
function ${1:name}(${2: \$${3:arg} ${4:= $5 }}) {
$0
}
@lumpysimon
lumpysimon / Lumpy error log.sublime-snippet
Created Mar 21, 2013
Sublime Text snippet: PHP error_log print_r
View Lumpy error log.sublime-snippet
<snippet>
<content><![CDATA[error_log( "Lumpy: $1 " ${2:. print_r( \$$3 , true )} );]]></content>
<tabTrigger>lel</tabTrigger>
<scope>source.php</scope>
<description>error_log (Lumpy PHP)</description>
</snippet>