Skip to content

Instantly share code, notes, and snippets.

View spigotdesign's full-sized avatar

Bryan Hoffman spigotdesign

View GitHub Profile
The website encountered an error while retrieving https://cinchws.com/wp-admin/edit.php?s=&post_status=all&post_type=shop_order&_wpnonce=55c2dc4bff&_wp_http_referer=%2Fwp-admin%2Fedit.php%3Fpost_type%3Dshop_order&action=mark_completed&m=0&_email_id=&_customer_user=&shop_order_subtype=&paged=1&post%5B%5D=1902&post%5B%5D=1899&post%5B%5D=1897&post%5B%5D=1895&post%5B%5D=1893&post%5B%5D=1890&post%5B%5D=1882&action2=-1. It may be down for maintenance or configured incorrectly.
@spigotdesign
spigotdesign / get-svg.php
Created January 25, 2016 21:29
WordPress get SVG file contents
<?php echo file_get_contents( get_stylesheet_directory_uri() . '/img/icons/your-logo-file.svg' ); ?>
<?php get_template_part('inc/my', 'snippet'); ?>
<?php include(locate_template('inc/my-snippet.php')); ?>
@spigotdesign
spigotdesign / wp-config.php
Created February 23, 2016 23:29
Turn on WordPress error reporting
// define('WP_DEBUG', false);
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);
@spigotdesign
spigotdesign / acf-get-image.php
Last active March 1, 2016 19:01
ACF Get Image snippets
<?php // Get Image url (for background) ?>
<?php $bgImage = esc_html(get_field('img_field')); ?>
<?php $bgURL = wp_get_attachment_image_src($bgImage, 'full'); ?>
<div class="bg" style="background-image: url(<?php echo $bgURL[0]; ?>);"></div>
<?php // Get Image attatchment (for full image output) ?>
<?php $bpImage = esc_html(get_field('img_field')); ?>
<?php echo wp_get_attachment_image($bpImage, 'full'); ?>
@spigotdesign
spigotdesign / get-parent-page-title.php
Last active October 7, 2016 21:05
Get the title of the parent page; If no parent, show this page's title
<?php echo empty( $post->post_parent ) ? get_the_title( $post->ID ) : get_the_title( $post->post_parent ); ?>
<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->post_parent) ); ?>
@spigotdesign
spigotdesign / woocommerce-icons.php
Created July 29, 2016 16:03
Custom WooCommerce icons for Stripe
// Custom Credit Card Icons
add_filter ('woocommerce_gateway_icon', 'custom_woocommerce_icons');
function custom_woocommerce_icons() {
$icon = '<img src="' . trailingslashit( get_template_directory_uri() ) . 'img/build/svg/visa.svg' . '" alt="Visa" />';
$icon .= '<img src="' . trailingslashit( get_template_directory_uri() ) . 'img/build/svg/mastercard.svg' . '" alt="Mastercard" />';
$icon .= '<img src="' . trailingslashit( get_template_directory_uri() ) . 'img/build/svg/amex.svg' . '" alt="American Express" />';
$icon .= '<img src="' . trailingslashit( get_template_directory_uri() ) . 'img/build/svg/discover.svg' . '" alt="Visa" />';
$icon .= '<img src="' . trailingslashit( get_template_directory_uri() ) . 'img/build/svg/jcb.svg' . '" alt="JCB" />';
$icon .= '<img src="' . trailingslashit( get_template_directory_uri() ) . 'img/build/svg/diners.svg' . '" alt="Diners Club" />';
@spigotdesign
spigotdesign / remove-query-string.php
Created August 30, 2016 17:02
Remove static query strings in WP
function spigot_remove_query_string( $src ){
return remove_query_arg( 'ver', $src );
}
add_filter( 'script_loader_src', 'spigot_remove_query_string' );
add_filter( 'style_loader_src', 'spigot_remove_query_string' );