Skip to content

Instantly share code, notes, and snippets.

View blogjunkie's full-sized avatar

David Wang blogjunkie

View GitHub Profile
@billerickson
billerickson / gist:1325966
Created October 30, 2011 14:36
Add Blog to Breadcrumbs
<?php
/**
* Add Blog to Breadcrumbs
* @author Bill Erickson
* @link http://www.billerickson.net/adding-blog-to-genesis-breadcrumbs/
*
* @param string original breadcrumb
* @return string modified breadcrumb
*/
function be_add_blog_crumb( $crumb, $args ) {
@franz-josef-kaiser
franz-josef-kaiser / deprecated.md
Last active October 1, 2015 01:07
is_ssl() for most cases - mu-plugin

Deprecated

For a Replacement visit this project on our GitHub organisation account.

@thegdshop
thegdshop / gist:2141771
Created March 20, 2012 22:08
WooCommerce - Change add to cart button text
<?php
add_filter('single_add_to_cart_text', 'woo_custom_cart_button_text');
function woo_custom_cart_button_text() {
return __('My Button Text', 'woocommerce');
}
@kloon
kloon / wp-config.php
Created October 25, 2013 06:49
WordPress 3.7 Enable/Disable Automatic Updates
// Enable Automatic Updates for all updates
define( 'WP_AUTO_UPDATE_CORE', true );
// Disable Automatic Updates for all updates
define( 'WP_AUTO_UPDATE_CORE', false );
// Only allow Automatic Updates for minor updates
define( 'WP_AUTO_UPDATE_CORE', 'minor' );
<?php //remove this line
function disable_self_ping( &$links ) {
foreach ( $links as $l => $link )
if ( 0 === strpos( $link, get_option( 'home' ) ) )
unset($links[$l]);
}
add_action( 'pre_ping', 'disable_self_ping' );
@blogjunkie
blogjunkie / template-page-builder.php
Last active May 11, 2016 13:28
A custom page template for #GenesisWP to play nice with page builders by making the content area full width. Works great with the Beaver Builder http://clickwp.me/beaver
<?php
/**
* Template Name: Page Builder
*
* This page template only works with Genesis child themes and works great with the
* Beaver Builder plugin. Learn more: http://clickwp.com/blog/beaver-builder/
*/
// Force full width content layout to remove sidebar
@evanwebdesign
evanwebdesign / genesis-remove-custom-title-logo.php
Last active June 20, 2016 11:13
Remove custom title/logo from Genesis theme options and customizer
<?php
/* Removing custom title/logo metabox from Genesis theme options page.
* See http://www.billerickson.net/code/remove-metaboxes-from-genesis-theme-settings/
* Updated to use $_genesis_admin_settings instead of legacy variable in Bill's example.
*/
add_action( 'genesis_theme_settings_metaboxes', 'be_remove_metaboxes' );
function be_remove_metaboxes( $_genesis_admin_settings ) {
remove_meta_box( 'genesis-theme-settings-header', $_genesis_admin_settings, 'main' );
@kloon
kloon / functions.php
Created February 13, 2013 08:25
WooCommerce CC all emails
<?php
add_filter('woocommerce_email_headers', 'woo_cc_emails' );
function woo_cc_emails() {
return 'Bcc: youremail@yourdomain.com' . "\r\n";
}
?>
@ChrisCree
ChrisCree / functions.php
Last active October 19, 2017 20:26
Force IE not to use so-called "compatibility" mode in the Genesis theme framework.
<?php
// Do not copy opening php tag
// Force Stupid IE to NOT use compatibility mode
add_filter( 'wp_headers', 'wsm_keep_ie_modern' );
function wsm_keep_ie_modern( $headers ) {
if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false ) ) {
$headers['X-UA-Compatible'] = 'IE=edge,chrome=1';
}
return $headers;
@carasmo
carasmo / remove-beaver-builder-from-admin-woocommerce.php
Last active January 5, 2018 23:32
Remove Beaver Builder link and tab in Admin for WooCommerce pages
<?php
//* DON'T ADD ABOVE
/*
*
* READ ME:
* I'm using Beaver Builder for page post types and I don't want that option on
* WooCommerce store, cart, checkout, and my account pages. I don't want the client to ask why she can't change