Skip to content

Instantly share code, notes, and snippets.

View GaryJones's full-sized avatar

Gary Jones GaryJones

View GitHub Profile
@GaryJones
GaryJones / gist:1698383
Last active September 30, 2015 01:17
WordPress theme license header tags
License: GPL-2.0+
License URI: http://www.opensource.org/licenses/gpl-license.php
@GaryJones
GaryJones / functions.php
Created January 29, 2012 11:39
Remove title attributes on Genesis-created (vetigial) menus
<?php
add_filter( 'genesis_nav_items', 'child_remove_navigation_titles' );
/**
* Remove all title attributes on Genesis-created navigation menus.
*
* @author Gary Jones
* @link http://code.garyjones.co.uk/remove-genesis-navigation-titles
*
* @param string $menu HTML markup of menu list items
@GaryJones
GaryJones / functions.php
Created January 29, 2012 11:46
Selectively remove title attributes on Genesis-created (vestigial) menus
<?php
// Optionally remove from WP custom menus too
add_filter( 'wp_nav_menu_items', 'child_remove_primary_navigation_titles', 10, 2);
add_filter( 'genesis_nav_items', 'child_remove_primary_navigation_titles', 10, 2 );
/**
* Remove all title attributes on Genesis-created navigation menus in the primary location.
*
* @author Gary Jones
@GaryJones
GaryJones / style.css
Created January 29, 2012 11:59
Add CSS line numbers to embedded gists.
.gist-highlight {
border-left: 4ex solid #eaeaea;
position: relative;
}
.gist-highlight pre {
counter-reset: linenumbers;
}
.gist-highlight pre div:before {
@GaryJones
GaryJones / gist:1698692
Created January 29, 2012 12:53
Amendments to oEmbed Gist WP plugin (http://wordpress.org/extend/plugins/oembed-gist/)
<?php
/*
Plugin Name: oEmbed gist
Plugin URI: http://firegoby.theta.ne.jp/wp/oembed-gist
Description: Embed source from gist.github.
Author: Takayuki Miyauchi (THETA NETWORKS Co,.Ltd)
Version: 1.2.0-gj
Author URI: http://firegoby.theta.ne.jp/
*/
@GaryJones
GaryJones / functions.php
Last active August 25, 2018 11:44
Conditionally add IE style sheets in WP
<?php
add_action( 'wp_print_styles', 'child_add_ie7_style_sheet', 200 );
/**
* Enqueue an IE-specific style sheet (for all browsers).
*
* @author Gary Jones
* @link https://garyjones.io/ie-conditional-style-sheets-wordpress
*/
function child_add_ie7_style_sheet() {
@GaryJones
GaryJones / functions.php
Created January 30, 2012 23:49
Modify Genesis home breadcrumb link
<?php
add_filter ( 'genesis_home_crumb', 'child_amend_home_breadcrumb_link' ); // Genesis >= 1.5
add_filter ( 'genesis_breadcrumb_homelink', 'child_amend_home_breadcrumb_link' ); // Genesis =< 1.4.1
/**
* Amend Home breadcrumb link.
*
* @author Gary Jones
* @link http://code.garyjones.co.uk/modify-genesis-breadcrumb-home-link/
*
@GaryJones
GaryJones / functions.php
Created January 30, 2012 23:58
Add post_terms shortcode (Genesis pre-1.4.2)
<?php
add_shortcode( 'post_terms', 'child_post_terms_shortcode' );
/**
* Add linked post taxonomy terms via shortcode.
*
* Not needed since Genesis 1.4.2 as it exists in Genesis.
* @author Ade Walker and Gary Jones
* @link http://code.garyjones.co.uk/post-taxonomy-terms-shortcode/
*
@GaryJones
GaryJones / functions.php
Created January 31, 2012 00:05
Add font options in Prose child theme
<?php
add_filter( 'prose_font_family_options', 'custom_prose_font_family_options' );
/**
* Add new font options.
*
* Ensure that double-quotes wrap the font stack variable, with single quotes
* wrap multi-word fonts.
*
* @param array $options Font options ( 'Display Name', 'font stack' ).
@GaryJones
GaryJones / functions.php
Created January 31, 2012 00:06
Edit existing font options in Prose
<?php
add_filter('prose_font_family_options', 'custom_prose_font_family_options');
/**
* Edit a Prose font stack option.
*
* Ensure that double-quotes wrap the font stack variable, with single quotes
* wrap multi-word fonts.
*
* @param array $options Font options ( 'Display Name', 'font stack' ).