Skip to content

Instantly share code, notes, and snippets.

View wpsmith's full-sized avatar

Travis Smith wpsmith

View GitHub Profile
phpcs.standard = WordPress
phpcs.tabWidth = 4
phpcs.encoding = utf-8
ftp.host = ftp.example.com
ftp.port = 21
ftp.username = username
ftp.password = password
ftp.project.dir = /subdomains/docs/httpdocs/${project.name.safe}
ftp.dir = ${ftp.project.dir}/${project.version}
@wpsmith
wpsmith / gist:4002176
Created November 2, 2012 15:50 — forked from billerickson/gist:2578637
CSS: Width including padding
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
@wpsmith
wpsmith / gist:4046082
Created November 9, 2012 14:44
VBA: Split CSV by rows of 25
Sub Split()
Dim rLastCell As Range
Dim rCells As Range
Dim strName As String
Dim lLoop As Long, lCopy As Long
Dim wbNew As Workbook
With ThisWorkbook.Sheets(1)
Set rLastCell = .Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious)
@wpsmith
wpsmith / content-sidebar-size.js
Created November 13, 2012 15:58
JS: Resizes Genesis Content-Sidebar to Equal Heights (responsively)
// Responsive: Get Width
jQuery(window).resize(function() {
// Set size of sidebar/content
selectorSizing( jQuery(this).width() );
});
/*
* Resizes the selector to the designated size
*
@wpsmith
wpsmith / wps_enqueue_jquery.php
Last active March 19, 2018 20:55
PHP: Enqueue Google CDN jQuery with fallback to WordPress
<?php
add_action( 'wp_enqueue_scripts', 'wps_enqueue_jquery' );
/**
* Enqueue jQuery from Google CDN with fallback to local WordPress
*
* @link http://codex.wordpress.org/Function_Reference/wp_enqueue_script
* @link http://codex.wordpress.org/Function_Reference/wp_register_script
* @link http://codex.wordpress.org/Function_Reference/wp_deregister_script
* @link http://codex.wordpress.org/Function_Reference/get_bloginfo
* @link http://codex.wordpress.org/Function_Reference/is_wp_error
@wpsmith
wpsmith / isotope.php
Created November 16, 2012 04:05
PHP: Properly Load Isotope
<?php
add_action( 'wp_enqueue_scripts', 'wps_load_scripts' );
/**
* Enqueue Isotope
* For commercially developed child themes, you must obtain a license
* from isotope.metafizzy.co for approx. $25.
*
* @link http://isotope.metafizzy.co/
* @link https://github.com/desandro/isotope
* @link http://codex.wordpress.org/Function_Reference/wp_enqueue_script
@wpsmith
wpsmith / wps_remove_soliloquy_style.php
Created November 19, 2012 01:41
PHP: Dequeue Soliloquy Style
<?php
add_action( 'tgmsp_before_slider_output', 'wps_remove_soliloquy_style' );
/**
* Remove Soliloquy Style
*
* @uses wp_dequeue_style() Remove a CSS file that was enqueued with wp_enqueue_style().
*/
function wps_remove_soliloquy_style() {
wp_dequeue_style( 'soliloquy-style' );
}
@wpsmith
wpsmith / wp_private_page_filters.php
Created December 4, 2012 13:06 — forked from stephanieleary/wp_private_page_filters.php
Private page filters for WordPress. Related to ticket #8592.
/**
* Add private/draft/future/pending pages to parent dropdown in page attributes metabox and Quick Edit
*
* @param array $dropdown_args
* @param object $post (Optional)
* @return array $dropdown_args
*/
function page_attributes_metabox_add_parents( $dropdown_args, $post = NULL ) {
$dropdown_args['post_status'] = array('publish', 'draft', 'pending', 'future', 'private');
return $dropdown_args;
@wpsmith
wpsmith / functions.php
Created December 6, 2012 19:54 — forked from GaryJones/functions.php
Genesis Grid Loop Advanced
<?php
/**
* Possibly amend the loop.
*
* Specify the conditions under which the grid loop should be used.
*
* @author Bill Erickson
* @author Gary Jones
* @link http://code.garyjones.co.uk/genesis-grid-loop-advanced/
add_action( 'wp_enqueue_scripts', 'child_load_google_font' );
/**
* Enqueue Google Font
*
* @author Greg Rickaby
* @since 1.0
*/
function child_load_google_font() {
$protocol = is_ssl() ? 'https' : 'http';