Skip to content

Instantly share code, notes, and snippets.

View addisonhall's full-sized avatar

Addison Hall addisonhall

View GitHub Profile
@addisonhall
addisonhall / wpsp_remove_permalinks.php
Last active December 2, 2017 16:18
Add this to WordPress functions.php to selectively disable permalinks on the WP Show Posts plugin. (https://wpshowposts.com/)
@addisonhall
addisonhall / content-cpt-output-list.php
Last active November 4, 2017 20:21
WordPress shortcode example: output custom post type list by custom taxonomy
<?php
/**
* Partial for custom_post_type_list shortcode output.
*
* @package ChildTheme
*/
if ( ! defined( 'ABSPATH' ) ) exit; ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
@addisonhall
addisonhall / shortcodes-ultimate-columns-override.css
Created September 22, 2017 18:54
Mo' better responsive row and column styling for WP Shortcodes Ultimate
/* Shortcodes Utlimate Rows and Columns */
.gpc .su-row {
margin: 0 -2% 1.5em -2%;
}
.gpc .su-row .su-column {
margin-left: 0;
margin-right: 0;
padding: 0 2% 0;
}
.gpc .su-column-size-1-1 { width: 100%; }
@addisonhall
addisonhall / fa-social-media-colors.css
Last active April 2, 2017 07:14
Often-used Font Awesome social media colors
/* Social media fontawesome colors */
a .fa-twitter-square { color: #00aced; }
a .fa-facebook-square { color: #3b5998; }
a .fa-youtube-square { color: #bb0000; }
a .fa-google-plus-square { color: #dd4b39; }
a .fa-linkedin-square { color: #007bb6; }
a .fa-instagram { color: #517fa4; }
@addisonhall
addisonhall / _helpers.scss
Last active March 20, 2017 05:17
Simple SASS starter files
// Social media fontawesome colors
a .fa-square { color: #fff; }
a .fa-twitter-square, a .fa-twitter { color: #00aced; }
a .fa-facebook-square, a .fa-facebook { color: #3b5998; }
a .fa-youtube-square, a .fa-youtube { color: #bb0000; }
a .fa-google-plus-square, a .fa-google-plus { color: #dd4b39; }
a .fa-linkedin-square, a .fa-linkedin { color: #007bb6; }
a .fa-pinterest-square, a .fa-pinterest { color: #cb2027; }
a .fa-vimeo-square, a .fa-vimeo { color: #aad450; }
a .fa-instagram { color: #517fa4; }
@addisonhall
addisonhall / gzip-compression
Created April 28, 2015 21:40
Gzip configuration that works for now...
# gzip compression -- make it faster!
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-httpd-php
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
Header append Vary User-Agent env=!dont-vary
@addisonhall
addisonhall / detect-orientation.js
Last active January 16, 2017 11:30
Detect screen orientation (landscape or portrait)
// Declare globally to use throughout
var deviceOrientation = '';
// ----------------------------------------------------
// Detect screen orientation
// ----------------------------------------------------
function detectOrientation() {
var height = $(window).height();
var width = $(window).width();
if(width > height) {
@addisonhall
addisonhall / check-size-and-orientation.js
Last active January 16, 2017 11:28
Get screen width, height, and orientation
// ----------------------------------------------
// Detect screen orientation
// ----------------------------------------------
var deviceOrientation = ''; // Declare globally to use throughout
function detectOrientation () {
var windowWidth = $(window).height();
var windowHeight = $(window).width();
if (windowWidth > windowHeight) {
deviceOrientation = 'landscape';
} else {
@addisonhall
addisonhall / bespoke-shopify-macro.php
Last active October 27, 2016 15:45
Bespoke Shipping macro for Shopify -- specify perishable goods and restrict shipping choices
<?php
/* This macro will be parsed as PHP code (see http://www.php.net)
The calculateshipping function is called every time a shipping calculation request is made by Shopify.
The function must return an array of available shipping options, otherwise no shipping options will be returned to your customers.
*/
function calculateshipping($DATA) {
/* do not edit above this line */
@addisonhall
addisonhall / _meta.yaml
Created March 23, 2015 13:01
Statamic SEO fieldset
title: Meta Fields
fields:
meta_section:
display: SEO
type: section
page_title:
display: SEO Page Title