Skip to content

Instantly share code, notes, and snippets.

View GaryJones's full-sized avatar

Gary Jones GaryJones

View GitHub Profile
@GaryJones
GaryJones / functions-defaults.php
Created January 31, 2012 01:28
Modify Genesis breadcrumb display
<?php
add_filter( 'genesis_breadcrumb_args', 'child_breadcrumb_args' );
/**
* Amend Genesis breadcrumb options.
*
* @author Gary Jones
* @link http://code.garyjones.co.uk/modify-breadcrumb-display/
*
* @param array $args Default breadcrumb arguments.
@GaryJones
GaryJones / functions.php
Created January 31, 2012 01:35
Style the post date on the Genesis post info line
<?php
add_filter( 'genesis_post_date_shortcode', 'child_post_date_shortcode', 10, 2 );
/**
* Customize Post Date format and add extra markup for CSS targeting.
*
* @author Gary Jones
* @link http://code.garyjones.co.uk/style-post-info/
*
* @param string $output Current HTML markup.
@GaryJones
GaryJones / functions.php
Created January 31, 2012 01:42
Change the Genesis comment count wording
<?php
add_filter( 'genesis_post_meta', 'child_post_meta_filter' );
/**
* Amend the post meta to change the wording for comments.
*
* @author Gary Jones
* @link http://code.garyjones.co.uk/change-comment-count/
*
* @param string $post_meta HTML markup, likely with shortcodes.
@GaryJones
GaryJones / functions.php
Last active June 24, 2017 19:40
Style the Genesis comment count number
<?php
// Don't include above <?php
add_filter( 'genesis_post_comments_shortcode', 'prefix_post_comments_shortcode' );
/**
* Amend the post comments shortcode to add extra markup for styling.
*
* @author Gary Jones
* @link http://gamajo.com/style-comment-number/
@GaryJones
GaryJones / style.css
Created February 2, 2012 04:46
Minimum solution for setting all text colours within the Genesis child theme
body,
h2 a,
h2 a:visited,
#title a,
.menu a,
.widget-area h4 a,
#footer a {
color: #333;
}
@GaryJones
GaryJones / style.css
Created February 2, 2012 05:38
Genesis Typography CSS
/* List Styles
------------------------------------------------------------ */
ol li {
list-style-type: decimal;
}
.archive-page ul li,
.entry-content ul li {
list-style-type: square;
@GaryJones
GaryJones / .htaccess
Created February 4, 2012 03:05
.htaccess performance and other improvements
# Increase the memory usage.
# If you get an error after adding this, try 64M or 32M instead.
php_value memory_limit "128M"
# Add syntax highlighting
AddType application/x-httpd-php-source .phps
# JavaScript
# Normalize to standard type (it's sniffed in IE anyways)
# tools.ietf.org/html/rfc4329#section-7.2
@GaryJones
GaryJones / functions.php
Created February 5, 2012 18:56
Display linked categories and the posts within those categories.
<?php
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'gmj_category_listings' );
/**
* Display linked categories and the posts within those categories.
*
* @author Gary Jones
* @link https://gist.github.com/1747188
*/
@GaryJones
GaryJones / functions.php
Created February 7, 2012 01:36
Add pinterest link after each post, only on singles.
<?php
add_action( 'genesis_post_content', 'child_add_pinterest_link', 15 );
/**
* Add pinterest link after post.
*
* Conditionally limited to single post. Remove the first conditional
* to make it show up on archive pages too.
*
* @since 1.0.0
@GaryJones
GaryJones / .htaccess
Created February 8, 2012 15:31
.htaccess conditional application/xhtml+xml serving solutions
# Contains a list of potential solutions to amend and investigate later.
# http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml