Skip to content

Instantly share code, notes, and snippets.

View bhwebworks's full-sized avatar

John Sundberg bhwebworks

View GitHub Profile
@bhwebworks
bhwebworks / gist:5153972
Last active December 14, 2015 21:49
Load FooBox plugin scripts and styles only when needed
/**
* Disable Foobox script unless needed
*
* @link http://justintadlock.com/archives/2009/08/06/how-to-disable-scripts-and-styles
* @since 1.2
*/
add_action( 'wp_print_scripts', 'bhww_disable_foobox_script', 100 );
function bhww_disable_foobox_script() {
@bhwebworks
bhwebworks / gist:5154038
Last active December 14, 2015 21:49
Slight modification to foobox.php to enable removing the FooBox inline script
//At line 1518 I changed
new foobox();
//to this:
$foobox = new foobox();
@bhwebworks
bhwebworks / gist:5272226
Last active December 15, 2015 14:09
Filter Soliloquy Featured Content Slider post data to include URL entered as Slide custom post type Slide Link
/**
* Filter Soliloquy Featured Content Slider post data to include URL entered as Slide custom post type Slide Link
* @since 1.0
*
*/
add_filter( 'tgmsp_fc_image_data', 'bhww_soliloquy_add_custom_link', 10, 4 );
function bhww_soliloquy_add_custom_link( $data, $post, $id ) {
@bhwebworks
bhwebworks / gist:5272349
Last active December 15, 2015 14:09
Create the 'Slides' custom post type and custom meta boxes
/**
* Create the 'Slides' custom post type
* @since 1.0
*
*/
add_action( 'init', 'bhww_register_slides_cpt' );
function bhww_register_slides_cpt() {
@bhwebworks
bhwebworks / edit functions.php
Last active December 17, 2015 05:08
Comment out the “Add support for custom header” code in functions.php
/** Add support for custom header */
/* add_theme_support( 'genesis-custom-header', array(
'width' => 1140,
'height' => 120
) ); */
@bhwebworks
bhwebworks / add to functions.php
Last active December 17, 2015 05:09
Filter the genesis_seo_site_title function to use an image for the logo instead of a background image
/**
* Filter the genesis_seo_site_title function to use an image for the logo instead of a background image
*
* The genesis_seo_site_title function is located in genesis/lib/structure/header.php
* @link http://blackhillswebworks.com/?p=4144
*
*/
add_filter( 'genesis_seo_title', 'bhww_filter_genesis_seo_site_title', 10, 2 );
@bhwebworks
bhwebworks / edit style.css
Created May 10, 2013 17:18
StudioPress image logo CSS edits
#header {
background-position: top center !important;
background-color: #111;
/* min-height: 120px; */
overflow: hidden;
width: 100%;
}
.header-image #title-area,
.header-image #title,
@bhwebworks
bhwebworks / add to functions.php
Created May 10, 2013 23:39
Remove the StudioPress site description
/**
* Remove the site description
*
* @link http://www.briangardner.com/code/remove-header-elements/
*/
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
@bhwebworks
bhwebworks / found in functions.php
Created May 17, 2013 15:57
Add span class to widget headlines
// Add span class to widget headlines
add_filter( 'widget_title', 'metro_widget_title' );
function metro_widget_title( $title ){
if( $title )
return sprintf('<span class="widget-headline">%s</span>', $title );
}
<div class="gist-container">
https://gist.github.com/6146811
</div>