Skip to content

Instantly share code, notes, and snippets.

View billcotter's full-sized avatar

Bill Cotter billcotter

  • New York, New York
View GitHub Profile
@lukecav
lukecav / wp-config.php
Last active August 12, 2016 18:21
Define CloudFlare API key in wp-config if using WP Rocket
define('WP_ROCKET_CF_API_KEY', 'put-your-API-key-here');
@lukecav
lukecav / cli.php
Last active August 4, 2016 19:39
WP-CLI - Digest command
/**
* Display Digest of Info.
*
* @param null $args Unused.
* @param array $assoc_args Unused.
*/
public function digest( $args, $assoc_args ) {
global $wpdb;
global $wp_version;
$details = array();

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

<?php
/**
* Genesis Framework.
*
* WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances.
* Please do all modifications in the form of a child theme.
*
* @package Genesis\Framework
* @author StudioPress
* @license GPL-2.0+
<?php
/**
* Template Name: Office Hours Template
* Description: Used as a page template to show page contents, followed by a loop
* through the "Genesis Office Hours" category
*/
// Add our custom loop
add_action( 'genesis_loop', 'cd_goh_loop' );
@cdils
cdils / archive-testimonials.php
Created March 13, 2013 13:49
Testimonial Archive Template
<?php
/**
* Template Name: Testimonial Archives
* Description: Used as a page template to show page contents, followed by a loop through a CPT archive
*/
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
add_action( 'genesis_loop', 'custom_do_grid_loop' ); // Add custom loop
@evansolomon
evansolomon / gist:2274120
Created April 1, 2012 09:36
nginx WordPress multisite config
server {
listen 80 default_server;
server_name domain.com *.domain.com;
root /srv/www/domain.com/public;
access_log /srv/www/domain.com/log/access.log;
error_log /srv/www/domain.com/log/error.log;
location / {
index index.php;
<?php
// This is on the taxonomy archive page, like taxonomy-colors.php
// First get the info about the current term
$term = get_term_by( 'slug', get_query_var( 'colors' ), 'colors' );
// Then see if there's any children of this tax term
$children = get_terms( 'colors', array( 'child_of' => $term->term_id ) );
@billerickson
billerickson / gist:1325304
Created October 30, 2011 00:36
List Posts tagged 'thesis-tip'
<?php
/**
* List Posts tagged 'thesis-tip'
*
*/
function be_display_thesis_tip() {
$args = array(
'tag' => 'thesis-tip',
'posts_per_page' => '-1',