Skip to content

Instantly share code, notes, and snippets.

View GaryJones's full-sized avatar

Gary Jones GaryJones

View GitHub Profile
@GaryJones
GaryJones / functions.php
Created May 30, 2015 08:51
bookmarks.gj theme
<?php
/** Start the engine **/
require_once( TEMPLATEPATH . '/lib/init.php' );
require_once( CHILD_DIR . '/tag_list_widget.php' );
require_once( CHILD_DIR . '/tag_chain_widget.php' );
require_once( CHILD_DIR . '/tag_filter_widget.php' );
/** Add support for custom background **/
add_theme_support( 'custom-background' );
Verifying I am +garyjones on my passcard. https://onename.com/garyjones
<?php
add_action( 'genesis_entry_content', 'kat_grid_content', 9 );
/**
* Change the number of words in excerpt if in the grid loop and customize READ MORE, add accessibility.
*/
function kat_grid_content() {
// Make sure we're in the grid loop.
if ( ! apply_filters( 'is_genesis_grid_loop', false ) ) {
return;
@GaryJones
GaryJones / commenting.php
Last active August 29, 2015 14:20
Test file for checking which Squiz.Commenting rules to ignore.
<?php
/**
* Summary (no period for file headers)
*
* Description (use period).
*
* @link http://example.com
* @since 5.0.0
*
* @package WordPress
@GaryJones
GaryJones / gist:56938d30bb86cd1c078a
Last active March 18, 2018 14:02
Config Files list

Config Files

Development-related files that might be found in version-controlled projects. Doesn't include editor-specific files.

Files

  • .editorconfig - EditorConfig define and maintain consistent coding styles between different editors and IDEs.
  • .gitignore - ignore files from version control. Note, don't add system files - contributors should be globally ignoring these on their local machines. Only use for files created during project build, credentials files etc.
<?php
/**
* Blog Intro
*/
add_action( 'genesis_before_loop', 'rgc_blog_intro' );
/**
* Add title and content before blog archive loop.
*
* @author Robin Cornett
@GaryJones
GaryJones / RedirectsCept.php
Last active May 20, 2019 15:21
Codeception 301 Redirection Tests
<?php
$I = new RedirectsTester($scenario);
$I->wantTo('check 301 redirects are working');
// First, test /login/ page gets rewritten to https://
$I->seePermanentRedirectToHttpsFor('login/');
$I->seePermanentRedirectToHttpsFor('login/?redirect_to=foo');
@GaryJones
GaryJones / functions.php
Last active December 23, 2021 23:10
Wrap the last Genesis breadcrumb in a span for styling.
<?php
add_filter( 'genesis_build_crumbs', 'gj_wrap_last_breadcrumb', 10, 2 );
/**
* Wrap the last Genesis breadcrumb in a span for styling.
*
* @author Gary Jones
*
* @param array $crumbs Existing HTML markup for the breadcrumbs.
*
@GaryJones
GaryJones / js.js
Created January 5, 2015 12:54
Gravity Forms Countries dropdown with country codes
var countryCodes = {
'Afghanistan': '93',
'Albania': '355',
'Algeria': '213',
'American Samoa': '684',
'Andorra': '376',
'Angola': '244',
'Antigua and Barbuda': '1-268',
'Argentina': '54',
'Armenia': '374',
<?php
/**
* Get post image.
*/
function wds_get_post_image( $size = 'thumbnail' ) {
// If featured image is present, use that
if ( has_post_thumbnail() ) {
return get_the_post_thumbnail( $size );