Skip to content

Instantly share code, notes, and snippets.

View rhyswynne's full-sized avatar

Rhys Wynne rhyswynne

View GitHub Profile
@rhyswynne
rhyswynne / gist:70801cff76a3ce23ec7d
Created November 11, 2014 21:28
My Sublime Text 2 Key Bindings
[
{ "keys": ["command+shift+i"], "command": "reindent", "args": {"single_line": false} },
{ "keys": ["ctrl+s"], "command": "snippets" }
]
@rhyswynne
rhyswynne / gist:3afb8524a19dcb643c9c
Last active August 29, 2015 14:09
My Default Sublime Text 2 Setup (as from WordPress Leeds 2014)
{
"font_size": 12.0,
// Set to true to turn spell checking on by default
"spell_check": false,
// The number of spaces a tab is considered equal to
"tab_size": 4,
// Set to true to insert spaces when tab is pressed
@rhyswynne
rhyswynne / activation-plugin.php
Created October 28, 2014 11:04
Code to Show a Wordpress Notice asking for a review after a week (blog post here - http://winwar.co.uk/2014/10/ask-wordpress-plugin-reviews-week/)
<?php
/*
Plugin Name: Activation Plugin Example
Plugin URI:
Description: Adds an Activation Hook & Displays a notice after 10 days.
Author: Winwar Media
Version: 0.1-alpha
Author URI: http://winwar.co.uk/
Text Domain:
Domain Path:
@rhyswynne
rhyswynne / functions.php
Created October 3, 2014 08:01
Proper way of including the Parent Styles.css
<?php
/*
Function: Include Parent Theme styles.css, the proper way.
*/
function child_theme_enqueue_stylesheets() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'child_theme_enqueue_stylesheets' );
@rhyswynne
rhyswynne / functions.php
Last active August 29, 2015 14:03
Example functions.php file. This removes the <title> tag and replaces it with the word "Hello!" - Don't run it on a live site!
<?php
// This file is loaded as well as the parent's (twentythirteen) child theme, so name your functions with a prefix. Like below:-
function twentythirteen_child_title( $title, $sep ) {
return "Hello!";
}
// This function is hooked in after the theme is set up. It removes the default title and replaces it with the word "Hello!". Don't run on a live site!
function twentythirteen_child_change_title() {
remove_filter( 'wp_title', 'twentythirteen_wp_title' );
@rhyswynne
rhyswynne / page.php
Created June 16, 2014 19:30
page.php (for #wcmcr)
<?php
/**
* The template for displaying all pages
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages and that other
* 'pages' on your WordPress site will use a different template.
*
* @package WordPress
* @subpackage Twenty_Thirteen
@rhyswynne
rhyswynne / style.css
Last active August 29, 2015 14:02
style.css 2 (for #wcmcr)
/*
Theme Name: Twenty Thirteen Child
Description: Twenty Thirteen Demo Child Theme for WordCamp.
Author: Rhys Wynne
Author URI: http://winwar.co.uk
Template: twentythirteen
Version: 1.0.0
Text Domain: twenty-thirteen-child
*/
@rhyswynne
rhyswynne / style.css
Created June 16, 2014 19:01
Start of a Child Theme (#wcmcr theme)
/*
Theme Name: Twenty Thirteen Child
Description: Twenty Thirteen Demo Child Theme for WordCamp.
Author: Rhys Wynne
Author URI: http://winwar.co.uk
Template: twentythirteen
Version: 1.0.0
Text Domain: twenty-thirteen-child
*/
@rhyswynne
rhyswynne / return_200
Created April 21, 2014 10:41
Stop WP Maintenance Mode returning a 503: Service Unavailable Error
<?php
add_filter('wp_maintenance_mode_status_code', 'rhyswynne_return_200',10,3);
function rhyswynne_return_200() {
return 200;
}
?>