Skip to content

Instantly share code, notes, and snippets.

View GaryJones's full-sized avatar

Gary Jones GaryJones

View GitHub Profile
@GaryJones
GaryJones / Preferences.sublime-settings
Created March 10, 2013 22:51
My Sublime Text 2 user preferences.
{
"auto_complete_commit_on_tab" : true,
"bold_folder_labels" : true,
"color_scheme" : "Packages/Tomorrow Color Schemes/Tomorrow-Night-Bright.tmTheme",
"default_line_ending" : "unix",
"ensure_newline_at_eof_on_save" : true,
"font_face" : "Ubuntu Mono",
"font_options" : ["subpixel_antialias"],
"font_size" : 14.0,
"highlight_line" : true,
<?php
/**
* WordPress Prep.
*
* Based from the WordPress Downloader
* http://www.farinspace.com/wordpress-downloader/
*
* @package wordpress-prep
* @version 1.0.1
* @author Jared Atchison
<?php
// Replace your current wps_do_pitbull_image_three() with:
function wps_do_pitbull_image_three() {
wps_id_open( 'pitbull_image_three' );
global $post;
wps_id_open( 'pitbull_image_three' );
echo '<p><img src="' .get_post_meta( $post->ID, '_d2c_pitbull_image_three', true ).'" /></p>';
@GaryJones
GaryJones / jquery-1.8.2.extern.js
Created January 23, 2013 00:11
jquery-1.8.2.extern.js
var jQuery = {
"fn": {
"init": function () {},
"selector": {},
"jquery": {},
"size": function () {},
"get": function () {},
"pushStack": function () {},
"setArray": function () {},
"each": function () {},
@GaryJones
GaryJones / functions.php
Created January 21, 2013 03:09
Add date menu item to end of existing menu items (in primary location).
<?php
add_filter( 'wp_nav_menu_items', 'gmj_add_date_menu_item', 10, 2 );
/**
* Add date menu item to end of existing menu items.
*
* @author Gary Jones
*
* @param string $items Menu items already converted to a string of markup.
* @args stdClass $args Menu arguments.
@GaryJones
GaryJones / functions.php
Created January 20, 2013 22:22
Change comment avatar size in Genesis child theme.
<?php
add_filter( 'genesis_comment_list_args', 'childtheme_comment_list_args' );
/**
* Change size of comment avatars.
*
* Value is side length of square avatar, in pixels.
*
* @author ipstenu
* @link http://www.studiopress.com/forums/topic/change-gravatar-size/
@GaryJones
GaryJones / genesis-simple-sidebars-exporter.php
Last active April 16, 2019 14:56
Genesis Simple Sidebars Exporter plugin
<?php
/**
* Genesis Simple Sidebars Exporter
*
* @package GaryJones\GenesisSimpleSidebarsExporter
* @author Gary Jones <[email protected]>
* @license GPL-2.0+
*
* @wordpress-plugin
* Plugin Name: Genesis Simple Sidebars Exporter
@GaryJones
GaryJones / functions.php
Last active December 11, 2015 01:18
Customize Genesis search input and button.
<?php
add_filter( 'genesis_search_text', 'custom_search_input_text' );
/**
* Customize the search form input button text.
*
* @param string $text Existing input text.
*
* @return string Amended input text.
*/
@GaryJones
GaryJones / class.php
Last active September 15, 2022 14:46
Class for calculating the greatest common factor of two or more numbers.
<?php
/**
* Greatest Common Factor.
*
* @package GreatestCommonFactor
* @author Gary Jones
* @link http://code.garyjones.co.uk/greatest-common-factor-class/
* @license http://gamajo.mit-license.org/2011
*/
@GaryJones
GaryJones / layout.php
Last active December 10, 2015 20:18
Genesis 1.9.0 change for referencing the child theme style sheet.
<?php
// lib/structure/layout.php in Genesis 1.8.2
add_action( 'genesis_meta', 'genesis_load_stylesheet' );
/**
* Echo reference to the style sheet.
*
* If a child theme is active, it loads the child theme's stylesheet,
* otherwise, it loads the Genesis stylesheet.