Skip to content

Instantly share code, notes, and snippets.

Travis Smith wpsmith

Block or report user

Report or block wpsmith

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View custom-footer.php
@wpsmith
wpsmith / home.php
Created Apr 29, 2012
Grid Home (focus)
View home.php
<?php
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'focus_grid_loop_helper' );
/** Add support for Genesis Grid Loop */
function focus_grid_loop_helper() {
if ( function_exists( 'genesis_grid_loop' ) ) {
genesis_grid_loop( array(
'features' => 4,
View author_box_filter.php
<?php
add_filter( 'genesis_author_box', 'wps_author_box', 10, 6 );
/*
* Filters author box
*/
function wps_author_box( $output, $context, $pattern, $gravatar, $title, $description ) {
$pattern = $context == 'single' ? '<div class="author-box"><div>%s %s<br />%s<br />%s</div></div><!-- end .authorbox-->' : '<div class="author-box">%s<h1>%s</h1><div>%s<br />%s</div></div><!-- end .authorbox-->';
$link = ''; //HTML Markup
return sprintf( $pattern, $gravatar, $title, $description, $link );
@wpsmith
wpsmith / prepopulate_radio.php
Created May 25, 2012
Prepopulate Radios in Gravity Forms
View prepopulate_radio.php
<?php
// Filter is applied to all forms
//add_filter('gform_pre_render', 'wps_populate_person');
// Filter only applied to Form id = 3
add_filter('gform_pre_render_3', 'wps_populate_person');
/**
* Pre-populates radios based on previous name field
* Searches post type 'person'
@wpsmith
wpsmith / taxonomies.php
Created May 30, 2012
Registering Multiple Taxonomies
View taxonomies.php
<?php
/**
* Taxonomies
*
* This file registers any custom taxonomies
*
* @package WPS_Starter_Genesis_Child
* @author Travis Smith <travis@wpsmith.net>
* @copyright Copyright (c) 2012, Travis Smith
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
View taxonomy_dropdown.php
<?php
/**
* Creates HTML markup for taxonomy dropdown
*
* @param string $taxonomy Registered taxonomy name
*/
function we_tax_dropdown( $taxonomy ) {
$terms = get_terms( $taxonomy );
$taxonomy = get_taxonomy( $taxonomy );
@wpsmith
wpsmith / global.js
Created Jun 29, 2012 — forked from jaredatch/global.js
Mobile Genesis menus
View global.js
jQuery(document).ready(function($){
// Mobile navigation
$('#prim-selector, #sec-selector').change(function(){
if ($(this).val()!='') {
window.location.href=$(this).val();
}
});
});
@wpsmith
wpsmith / gist:3025182
Created Jun 30, 2012
wp_generate_attachment_metadata() Output
View gist:3025182
Array
(
[width] => 612
[height] => 792
[hwstring_small] => height='96' width='74'
[file] => 2012/lowercase-print-dn-letter-a-z.jpg
[sizes] => Array
(
[thumbnail] => Array
(
@wpsmith
wpsmith / attachment_metadata.php
Created Jun 30, 2012
Attachment Metadata Query
View attachment_metadata.php
<?php
$args = array(
'post_status' => 'inherit', // Default status of attachments
'post_type' => array( 'attachment' ),
'meta_key' => '_wp_attachment_metadata',
'meta_value' => 'FinePix J10',
'meta_compare' => 'LIKE',
);
$attachment_query = new WP_Query( $args );
@wpsmith
wpsmith / wps_comment_form_args.php
Created Jul 17, 2012
Remove website field from Comments Form
View wps_comment_form_args.php
<?php
add_filter( 'genesis_comment_form_args', 'wps_comment_form_args' );
/**
* Remove website field from Comments Form
*
* @param array $args Comments form arguments.
* @return array $args Modified Comments form arguments.
*/
function wps_comment_form_args( $args ) {
unset( $args['fields']['url'] );
You can’t perform that action at this time.