Skip to content

Instantly share code, notes, and snippets.

View bhwebworks's full-sized avatar

John Sundberg bhwebworks

View GitHub Profile
@bhwebworks
bhwebworks / stream-filter-v1.php
Last active October 22, 2019 12:05
Prevent unwanted results from appearing in (future) Stream records
<?php
// Prevent unwanted results from appearing in (future) Stream records - v 1.x
add_filter( 'wp_stream_record_array', 'bhww_core_wp_stream_filter_record_array', 10, 1 );
function bhww_core_wp_stream_filter_record_array( $recordarr ) {
// BackupBuddy (iThemes) entries
$context = 'settings';
$option = 'ithemes-updater-cache';
@bhwebworks
bhwebworks / gist:9559948
Created March 15, 2014 00:32
Code to remove from Sixteen Nine Pro functions.php to remove the avatar image from the site header
//* Add support for custom header
add_theme_support( 'custom-header', array(
'admin-preview-callback' => 'sixteen_nine_admin_header_callback',
'default-text-color' => 'ffffff',
'header-selector' => '.site-header .site-avatar img',
'height' => 224,
'width' => 224,
'wp-head-callback' => '__return_false',
) );
<?php
add_action( 'tgmsp_before_slider_output', 'tgm_custom_slider_theme' );
function tgm_custom_slider_of_madness( $id ) {
// If not the proper slider ID, do nothing. Change to match your slider ID.
if ( '324' !== $id ) return;
// Dequeue the default styles.
wp_dequeue_style( 'soliloquy-style' );
/**
* Filter Event Organiser to use the timezone set in WordPress settings
*
* Uses a filter hook found in includes/class-eo-ical-parser.php
*
* @link http://blackhillswebworks.com/?p=5108
*/
add_filter( 'eventorganiser_ical_timezone', 'bhww_eo_set_timezone' );
<FilesMatch "\.(?i:pdf|doc|docx|jpg|xls|zip|txt)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
/**
* Redirect WordPress front end https URLs to http without a plugin
*
* Necessary when running forced SSL in admin and you don't want links to the front end to remain https.
*
* @link http://blackhillswebworks.com/?p=5088
*/
add_action( 'template_redirect', 'bhww_ssl_template_redirect', 1 );
//* Child theme (do not remove)
define( 'CHILD_THEME_NAME', __( 'Agency Pro Theme', 'agency' ) );
define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/agency/' );
define( 'CHILD_THEME_VERSION', '3.0.20131011' );
/**
* Filter Simple Page Ordering to exclude Pages but include custom post types that are hierarchical but don't have page attributes
*
* @link http://blackhillswebworks.com/?p=5017
*/
add_filter( 'simple_page_ordering_is_sortable', 'bhww_turn_off_simple_page_ordering_for_pages' );
function bhww_turn_off_simple_page_ordering_for_pages( $sortable ) {
/* HTML5 version */
.home .site-inner .soliloquy-container {
margin: 0 0 20px;
}
/* non-HTML5 version */
.home #inner .soliloquy-container {
margin: 0 0 20px;
}
/**
* Add a slider to the home page, if there is one to add
*
* @link http://blackhillswebworks.com/?p=4986
*/
add_action( 'genesis_before_content', 'metro_home_add_soliloquy_slider' );
function metro_home_add_soliloquy_slider() {