Skip to content

Instantly share code, notes, and snippets.

Mike Hemberger JiveDig

Block or report user

Report or block JiveDig

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JiveDig
JiveDig / functions.php
Created Aug 8, 2019
Automatically add facet label as a heading before any facets with available options to filter by.
View functions.php
<?php
/**
* Adds facet label as a heading before any facets with available options.
*
* @author Mike Hemberger @JiveDig.
*
* @param string $output The facet HTML.
* @param array $params The shortcode/function parameters.
*
@JiveDig
JiveDig / functions.php
Last active May 20, 2019
Remove taxonomies that you probably won't need, and take forever to load all the terms in ACF taxonomy field.
View functions.php
<?php
/**
* Remove taxonomies that you probably won't need, and take forever to load all the terms in ACF taxonomy field.
*
* @version 1.0.0
* @author @JiveDig
* @uses Advanced Custom Fields
*
* @param array $taxonomies The existing taxonomies.
@JiveDig
JiveDig / functions.php
Last active May 15, 2019
Create a direct to cart/checkout/page add to cart button in WooCommerce.
View functions.php
<?php
/**
* Create a direct to cart/checkout/page add to cart button.
*
* Example: [buy_now id="1234" redirect="checkout"]
*
* @version 1.0.0
* @author @JiveDig
* @link https://gist.github.com/JiveDig/6adde04666c189b6089fcfeca4988c47
@JiveDig
JiveDig / functions.php
Created Mar 28, 2019
Autocomplete WooCommerce orders that contain only virtual products.
View functions.php
<?php
/**
* Autocomplete orders that contain only virtual products.
* If the order contains a non-virtual product the order will not be completed by this function.
*
* @author Mike Hemberger @JiveDig
*
* @version 1.0.0
*
@JiveDig
JiveDig / wp_enqueue_scripts.php
Last active Feb 22, 2019
What happens when you try to enqueue a script in WordPress with the same handle or file name and location?
View wp_enqueue_scripts.php
<?php
$dir = get_stylesheet_directory_uri();
// Different scripts: Both are loaded.
wp_enqueue_script( 'test-one', $dir . '/assets/js/test-one.js', array(), '1.0.0', true );
wp_enqueue_script( 'test-two', $dir . '/assets/js/test-two.js', array(), '1.0.0', true );
// Identical scripts: 1 is loaded.
wp_enqueue_script( 'test-one', $dir . '/assets/js/test.js', array(), '1.0.0', true );
@JiveDig
JiveDig / functions.php
Last active Apr 18, 2019
Get the primary term of a post, by taxonomy. If Yoast Primary Term is used, return it, otherwise fallback to the first term.
View functions.php
<?php
/**
* Get the primary term of a post, by taxonomy.
* If Yoast Primary Term is used, return it,
* otherwise fallback to the first term.
*
* @version 1.1.0
*
* @link https://gist.github.com/JiveDig/5d1518f370b1605ae9c753f564b20b7f
@JiveDig
JiveDig / mai-lifestyle-homepage.json
Created Oct 15, 2018
Mai Lifestyle Pro Homepage demo import JSON
View mai-lifestyle-homepage.json
{"home_url":"https:\/\/maitheme.com\/mai-lifestyle-pro","layout":"full-width-content","banner_id":false,"hide_banner":"0","hide_breadcrumbs":"0","hide_featured":"1","excerpt":"Mai Lifestyle Pro is among StudioPress' top-3 best selling themes for the last five months in a row, Mai Theme is currently powering some of the most high-traffic websites on the Internet.","images":{"618":"https:\/\/maitheme.com\/mai-lifestyle-pro\/wp-content\/uploads\/2017\/05\/brooke-cagle-199262.jpg","1573":"https:\/\/maitheme.com\/mai-lifestyle-pro\/wp-content\/uploads\/2018\/01\/brooke-cagle-157923.jpg"},"sections":[{"bg":"#f0f0f0","image_id":"","image":false,"overlay":"","inner":"","height":"xs","content_width":"sm","align_content":"","align":"center","text_size":"xl","id":"","class":"","context":"","title":"","content":"<em>\u201cThe Perfect Theme for Wellness, Food\/Recipe, Fitness, Lifestyle, or Small Business Websites and Blogs.\u201d<\/em>"},{"bg":"#ffffff","image_id":"","image":false,"overlay":"","inner":"","height":"lg","c
View lifestyle-homepage-import.json
{"home_url":"https:\/\/maitheme.com\/mlpexport","layout":"full-width-content","banner_id":false,"hide_banner":"0","hide_breadcrumbs":"0","hide_featured":"1","excerpt":"","images":{"618":"https:\/\/maitheme.com\/mlpexport\/wp-content\/uploads\/2017\/05\/brooke-cagle-199262.jpg","1573":"https:\/\/maitheme.com\/mlpexport\/wp-content\/uploads\/2018\/01\/brooke-cagle-157923.jpg"},"sections":[{"bg":"#f0f0f0","image_id":"","image":false,"overlay":"","inner":"","height":"xs","content_width":"sm","align_content":"","align":"center","text_size":"xl","id":"","class":"","context":"","title":"","content":"<em>\u201cThe Perfect Theme for Wellness, Food\/Recipe, Fitness, Lifestyle, or Small Business Websites and Blogs.\u201d<\/em>"},{"bg":"#ffffff","image_id":"","image":false,"overlay":"","inner":"","height":"lg","content_width":"","align_content":"","align":"center","text_size":"","id":"latest-posts","class":"","context":"","title":"Latest Posts","content":"Read our latest tips, tricks, and musings below.\r\n\r\n[grid cont
@JiveDig
JiveDig / social-warfare-genesis.php
Last active Mar 28, 2018
Use Genesis hooks to display Social Warfare icons based on SW settings.
View social-warfare-genesis.php
<?php
/**
* Use Genesis hooks to display Social Warfare icons based on SW settings.
*
* @version 1.1.0
*
* @author Mike Hemberger @JiveDig
*
* @return void
@JiveDig
JiveDig / branding-mai-theme.css
Last active Mar 19, 2018
Mai Theme branding colors CSS
View branding-mai-theme.css
/**
* The code in the following files will allow you to quickly customize the colors/branding of your Mai Theme powered website.
* Add the code to the theme's style.css file and adjust the colors as-needed.
*/
You can’t perform that action at this time.