Skip to content

Instantly share code, notes, and snippets.

View bhubbard's full-sized avatar
:octocat:
Hello

Brandon Hubbard bhubbard

:octocat:
Hello
View GitHub Profile
<a class="houzz-share-button"
data-url="http://www.yoursite.com/product/page/ "
data-hzid="Your HZID"
data-title="Product Title as it will be seen inside Houzz "
data-img="http://yoursite/path/to/product/image.jpg "
data-desc="Product description text "
data-category="Category keywords "
data-showcount="1 "
href="https://www.houzz.com">Houzz</a>
<script>(function(d,s,id){if(!d.getElementById(id)){var js=d.createElement(s);js.id=id;js.async=true;js.src="//platform.houzz.com/js/widgets.js?"+(new Date().getTime());var ss=d.getElementsByTagName(s)[0];ss.parentNode.insertBefore(js,ss);}})(document,"script","houzzwidget-js");</script>
<?php
function themename_customize_register($wp_customize){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('Color Scheme', 'themename'),
'priority' => 120,
));
// =============================
@bhubbard
bhubbard / Common-Currency.json
Created December 21, 2015 19:20 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
<?php
/*
* Plugin Name: WP Engine GeoIP Debugger
* Version: 0.5
* Description: Debugging tool for WP Engine GeoIP
* Author: WP Engine
* Author URI: http://wpengine.com
*
* This will help confirm if GeoIP is returning the correct information. Check the error log after loading the front page of the site.
*/
@bhubbard
bhubbard / gist:3aab53ad2fd1e9099515
Created February 25, 2016 04:42 — forked from billerickson/gist:2047229
Improve performance of WP_Query
<?php
$args = array(
// Normal query goes here //
'no_found_rows' => true, // counts posts, remove if pagination required
'update_post_term_cache' => false, // grabs terms, remove if terms required (category, tag...)
'update_post_meta_cache' => false, // grabs post meta, remove if post meta required
);
@bhubbard
bhubbard / limit-tags.php
Last active February 25, 2016 04:50
Limit Tags Per Post
<?php
//* Limit tags to three per post...
add_filter( 'term_links-post_tag', 'wpdevco_limit_post_tags' );
function wpdevco_limit_post_tags( $terms ) {
return array_slice( $terms, 0, 3, true );
}
@bhubbard
bhubbard / gist:ffc1db1809edfc4bc57a
Created March 8, 2016 23:44 — forked from carsonmcdonald/gist:956349
Adding page load time tracking to Yoast's Google Analytics plugin
function gapagespeed($push)
{
$push[] = "'_trackPageLoadTime'";
return $push;
}
add_filter( 'yoast-ga-push-after-pageview', 'gapagespeed' );
@bhubbard
bhubbard / spamreferrals.txt
Created March 16, 2016 17:52 — forked from iMazed/spamreferrals.txt
Spam referral list to add to Google Analytics spam filters. Custom filter > Exlude > Campaign Source.
share-buttons.xyz
traffic2cash.xyz
с.новым.годом.рф
net-profits.xyz
social-widget.xyz
free-social-buttons.xyz
4webmasters.org
76brighton.co.uk
7makemoneyonline.com
acads.net
@bhubbard
bhubbard / gist:72bd34609a4d15488b7b
Created March 24, 2016 23:06 — forked from justinph/gist:5255773
How to find your CDN url in WordPress on WPEngine.
if (class_exists('WpeCommon')){
$wpe_common = new WpeCommon();
$cdn_url = $wpe_common->get_cdn_domain($wpe_netdna_domains,get_bloginfo( 'url' ) );
}
var_dump($cdn_url);
<?php
/*
Disable Dify
*/
add_action( 'admin_init', 'wpe_disable_dashboard_widgets', 9999 );
function wpe_disable_dashboard_widgets() {
remove_meta_box('dashboard_primary', 'dashboard', 'core'); // WordPress News Widget
remove_meta_box('wpe_dify_news_feed', 'dashboard', 'normal'); // WPEngine News Widget
}