Skip to content

Instantly share code, notes, and snippets.

View GaryJones's full-sized avatar

Gary Jones GaryJones

View GitHub Profile
@GaryJones
GaryJones / reverse-post-order.php
Last active December 19, 2015 10:29 — forked from robneu/reverse-post-order.php
Completely untested!
<?php
add_action( 'pre_get_posts', 'prefix_reverse_post_order' );
/**
* Reverse Post Order for Post Archives on the Genesis Framework
*
* @author FAT Media
* @link http://youneedfat.com/reverse-post-order-genesis-framework/
* @param object $query data
*
*/
@GaryJones
GaryJones / annotated-style.css
Last active December 18, 2015 13:48
CSS styles to fix the appearance of embedded gists in Genesis 2.0 / Sample child theme.
/* Same as other file, but with extra notes */
/* Embedded Gists */
.line-pre::before,
.line-pre::after,
.line::before,
.line::after {
content: ''; /* Fixes addition of float-clearing space added to before and after global pre and div elements */
}
@GaryJones
GaryJones / functions.php
Created May 30, 2013 09:00
Genesis - Add Top Menu
<?php
add_filter( 'genesis_default_menus', 'prefix_register_top_menu' );
function prefix_register_top_menu( array $menus ) {
$menus['top'] = __( 'Top Navigation Menu', 'prefix-domain' );
return $menus;
}
add_action('genesis_before_header', 'prefix_do_top_nav');
@GaryJones
GaryJones / gist:5648951
Created May 25, 2013 12:46
Genesis 2.0b1 rtl.css. Add this file as rtl.css to root of child themes, then install RTL Tester plugin, and switch to RTL.
/* WARNING - Please read the notice below:
This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances. Please do all modifications in the form of a child theme.
Copy the contents of this file to the child theme. Do not use @import, as the CSS included with Genesis might change in the future.
*/
body {
direction: rtl;
unicode-bidi: embed;
@GaryJones
GaryJones / functions.php
Last active December 17, 2015 11:29
Amended post date styling, including the year
<?php
add_filter( 'genesis_post_date_shortcode', 'child_post_date_shortcode', 10, 2 );
/**
* Customize Post Date format and add extra markup for CSS targeting.
*
* Includes the year as well.
*
* @author Gary Jones
* @link http://code.garyjones.co.uk/style-post-info/
<?php
add_action( 'genesis_before_post', 'dc_blah_feat' );
/**
* Echo parent page post thumbnail for a page.
*/
function dc_blah_feat () {
if ( is_page() )
echo prefix_get_page_parent_featured_image();
}
@GaryJones
GaryJones / gist:5271998
Created March 29, 2013 16:41
Genesis workflow using GitFlow.

Genesis Framework workflow on GitHub

General procedure is to follow the established GitFlow model.

Initial Setup

Assuming the move happens right after 2.0.0 is released.

  • All SVN tags moved in as Git Tags.
  • Code SVN tagged as 2.0.0 moved to Git master branch
  • Git master branch is branched to develop.

If work after 2.0.0 has already been committed to SVN trunk, then SVN trunk is moved to Git develop branch instead.

@GaryJones
GaryJones / functions.php
Created March 27, 2013 23:37
Insert ads or other content after specific paragraph in single post content. The second function here would be easily re-usable for inserting additional bits and pieces do whatever content under whatever conditions (e.g. Cinema tickets competition link after 3rd paragraph of Movie CPT).
<?php
add_filter( 'the_content', 'prefix_insert_post_ads' );
/**
* Insert code for ads after second paragraph of single post content.
*
* @param string $content Post content
*
* @return string Amended content
*/
@GaryJones
GaryJones / gist:5233669
Created March 24, 2013 21:41
Remove post title from Genesis breadcrumb (assumed on single.php, so limited possibilities). Completely untested.
<?php
add_filter( 'genesis_single_crumb', 'gj_single_crumb', 10, 2 );
/**
* Remove Post Title from Breadcrumb.
*
* Takes a substring of crumb, starting at 0, with a length of up to the last occurrence of the
* (start of the) separator string.
*/
function gj_single_crumb( $crumb, $args ) {
@GaryJones
GaryJones / gist:5232219
Last active December 15, 2015 08:39
Suggested CSS organisation for Genesis 2.0. Thoughts?
Imports
Base
- Reset
- Float Clearing
- Typography
- Headings
- Objects
- Forms
Layout
- Structure