This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Box Shadow</title> | |
<style> | |
.box { | |
height: 150px; | |
width: 300px; | |
margin: 20px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Flickity-based carousel for returning posts from the loop. I find it far more versatile and simple than a Bootstrap | |
* carousel. Get the required scripts and styles from here: https://flickity.metafizzy.co/ | |
*/ | |
<div class="blog-carousel"> | |
<?php | |
if ( have_posts() ) : while ( have_posts() ) : the_post(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Snippet to Change UPS account based on destination country while confirming shipment (not while generating packages). | |
* | |
*/ | |
add_filter( 'wf_ups_shipment_confirm_request_data', 'switch_origin_adress_based_on_country', 10, 2 ); | |
if( ! function_exists('switch_origin_adress_based_on_country') ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wf_default_shipping_method( $method ) { | |
$the_cheapest_cost = 1000000; | |
$packages = WC()->shipping()->get_packages()[0]['rates']; | |
foreach ( array_keys( $packages ) as $key ) { | |
if ( ( $packages[$key]->cost > 0 ) && ( $packages[$key]->cost < $the_cheapest_cost ) ) { | |
$the_cheapest_cost = $packages[$key]->cost; | |
$method_id = $packages[$key]->id; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Snippet to hide specified shipping methods with zero cost. | |
* Created at : 07 Nov 2018 | |
* Updated at : 07 Nov 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/varun-pluginhive/a7b88d265b5ecb89d823ffe9d06daf7c | |
*/ | |
add_filter( 'woocommerce_package_rates', function( $shipping_rates ){ | |
$shipping_methods = array( 'wf_woocommerce_shipping_pro:1shipping-pro-1'); // Array of Shipping method ids |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This function loops over cart items, and moves any item with shipping class 'special-class' into a new package. | |
* The new package in this example only takes flat rate shipping. | |
*/ | |
function split_special_shipping_class_items( $packages ) { | |
$found_item = false; | |
$special_class = 'special-class'; // edit this with the slug of your shippig class | |
$new_package = current( $packages ); | |
$new_package['contents'] = array(); | |
$new_package['contents_cost'] = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Note: Anyone could access your data if they guess this URL. You should remove this file from the server | |
// after importing or name it to something "unguessable". For even better security use an .htaccess rule. | |
// | |
// If you're experiencing problems you can uncomment the following line so errors will be sent to the file. | |
// ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); | |
// | |
// Enter the FTP (or HTTP) URL of your data file below. | |
$url = "ftp://username:[email protected]/full/path/to/file.csv"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install apt-transport-https ca-certificates -y | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
sudo rm -f /etc/apt/sources.list.d/docker.list | |
sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -u -cs) \ | |
stable" | |
sudo apt-get update | |
sudo apt-get purge lxc-docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Template for displaying product archives, including the main shop page which is a post type archive. | |
* | |
* Override this template by copying it to yourtheme/woocommerce/archive-product.php | |
* | |
* @author WooThemes | |
* @package WooCommerce/Templates | |
* @version 2.0.0 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Prevent Wordpress from wrapping images and iframes in p tags | |
* http://css-tricks.com/snippets/wordpress/remove-paragraph-tags-from-around-images/ | |
* ( <p> and <iframe> and ACF support - http://wordpress.stackexchange.com/questions/136840/how-to-remove-p-tags-around-img-and-iframe-tags-in-the-acf-wysiwyg-field | |
*/ | |
// Default Wordpress WYSIWYG | |
function filter_ptags_on_images_iframes($content) | |
{ | |
$content = preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content); |
NewerOlder