Skip to content

Instantly share code, notes, and snippets.

@jamiemitchell
jamiemitchell / archive-gallery.php
Created October 17, 2013 01:58
Ok, so the idea here is to show the artwork title, description, dimensions and price. But if the price metabox is blank, it just says sold.
<?php
/**
* Post Info
* Displayed below the post title on the single and archive view
* @author Bill Erickson
* @link http://wordpress.org/support/topic/plugin-interstrategy-events-manager-documentation?replies=4
*
* @param string, original post info
* @return string, modified post info
@jamiemitchell
jamiemitchell / functions.php
Last active December 26, 2015 00:39
Enqueue backstretch scripts as used on my site.
<?php
/* Add support for custom background
------------------------------------------------------------ */
add_theme_support( 'custom-background', array( 'wp-head-callback' => '__return_false' ) );
<?php
/* Force full width layout
------------------------------------------------------------ */
add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content');
@jamiemitchell
jamiemitchell / functions.php
Created October 20, 2013 07:31
Unregister site layouts in Genesis
<?php
/* Unregister site layouts
------------------------------------------------------------ */
genesis_unregister_layout( 'content-sidebar' );
genesis_unregister_layout( 'sidebar-content' );
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );
genesis_unregister_layout( 'sidebar-content-sidebar' );
@jamiemitchell
jamiemitchell / functions.php
Created October 20, 2013 07:34
Remove edit link
<?php
/* Remove the edit link
------------------------------------------------------------ */
add_filter ( 'genesis_edit_post_link' , '__return_false' );
@jamiemitchell
jamiemitchell / functions.php
Created October 20, 2013 07:43
Simple footer filter for Genesis
<?php
/* Site footer
------------------------------------------------------------ */
add_filter('genesis_footer_creds_text', 'jm_footer_creds_text');
function jm_footer_creds_text($creds) {
$creds = '&copy; 2013 &mdash; All Rights Reserved.';
return $creds;
}
@jamiemitchell
jamiemitchell / functions.php
Created October 20, 2013 07:46
Register some example widget areas in Genesis
<?php
/* Register widget areas
------------------------------------------------------------ */
genesis_register_sidebar( array(
'id' => 'home-welcome',
'name' => __( 'Home Welcome', 'jmd' ),
'description' => __( 'This is the home welcome section.', 'jmd' ),
) );
@jamiemitchell
jamiemitchell / archive-gallery.php
Last active December 26, 2015 02:09
Display custom metaboxes for art site on archive page. If price field in empty in backend the "Sold" will show.
@jamiemitchell
jamiemitchell / gist:7076094
Created October 20, 2013 22:21
Add column classes in Genesis
<?php
/* Add column classes
------------------------------------------------------------ */
add_filter( 'post_class', 'jm_archive_post_class' );
function jm_archive_post_class( $classes ) {
$classes[] = 'one-half';
global $wp_query;
if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 2 )