Skip to content

Instantly share code, notes, and snippets.

View chriswallace's full-sized avatar

Chris Wallace chriswallace

View GitHub Profile
@chriswallace
chriswallace / gist:dee2b8b38bb23351bfd4
Created April 29, 2015 19:14
Example CSS to limit the width of the posts everywhere in the Largo theme except on the single post template.
.archive #main,
.blog #main,
.search #main,
.error404 #main,
.home #main {
max-width: 800px;
margin: 0 auto;
}
@chriswallace
chriswallace / gist:c6a3ce6dc95ccf9e8443
Created April 29, 2015 15:01
Custom CSS to get rid of featured content sidebar in Largo theme.
.header-aside {
position: static;
left: auto;
top: auto;
bottom: auto;
width: auto;
margin-bottom: 20px;
height: 55px;
}
@chriswallace
chriswallace / tip_or_not.php
Last active August 29, 2015 14:14
Formula to determine whether or not to tip on take-out food.
/**
* The ballin' equation.
*/
function tip_or_not(){
if ( ballin() ) {
return true;
}
return false;
@chriswallace
chriswallace / theme-fonts.php
Last active April 28, 2017 21:46
Typecase theme support declaration for WordPress themes.
<?php
/**
* Declares support for font families within your WordPress theme.
*
* By adding this code to your theme, it notifies the Typecase plugin
* that your theme allows for custom font locations that can be modified via
* the Customizer.
*/
add_theme_support( 'typecase', array(
@chriswallace
chriswallace / change-person-slug.php
Last active August 29, 2015 14:10
Modify the slug for the person post type in the Church Theme Content plugin.
/**
* Modify the post type slug for the Person post type.
* ex: http://mychurch.org/people/ ~> http://mychurch.org/staff/
*/
function od_change_slug( $args ){
$args['rewrite']['slug'] = 'staff'; // New slug is 'staff'
return $args;
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
@chriswallace
chriswallace / functions.php
Created July 1, 2014 03:05
Child theme for Worldview
/**
* Returns the Google font stylesheet URL, if available.
*
* The use of Source Sans Pro and Bitter by default is localized. For languages
* that use characters not supported by the font, the font can be disabled.
*
* @return string Font stylesheet or empty string if disabled.
*/
function largo_fonts_url() {
$fonts_url = '';
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
# Global restrictions configuration file.
# Designed to be included in any server {} block.</p>
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
@chriswallace
chriswallace / gist:3305834
Created August 9, 2012 16:53
Base Class for Plugins
<?php
/*
Plugin Name: FontEasy
Plugin URI: http://upthemes.com
Description: A plugin that makes it dead simple to add custom webfonts to your website.
Version: 0.1
Author: Chris Wallace
Author URI: http://upthemes.com
License: GPL2
*/