Skip to content

Instantly share code, notes, and snippets.

View 1wdtv's full-sized avatar

1WD.tv - Make Money With Divi 1wdtv

View GitHub Profile
.et-cart-info { display:none; }
add_filter( 'woocommerce_add_to_cart_validation', 'lab_only_one_in_cart', 99, 2 );
function lab_only_one_in_cart( $passed, $added_product_id ) {
wc_empty_cart();
return $passed;
}
add_filter( 'wc_add_to_cart_message_html', '__return_false' );
<script>
jQuery(document).ready(function($){
var data = {
'primary_role' : 'buyer'
};
var data = {
'action' : 'update_user',
'data' : JSON.stringify( data )
<script>
jQuery(document).ready(function($){
var data = {
'primary_role' : 'broker'
};
var data = {
'action' : 'update_user',
'data' : JSON.stringify( data )
<script>
jQuery(document).ready(function($){
var data = {
'action': 'apply_tags',
'tags' : ["Add to Cart {{DLV - Product Name}}"]
};
$.post(wpf_ajax.ajaxurl, data);
@1wdtv
1wdtv / gist:0bbeff43d8103ef0e284d24ede60aea6
Created May 10, 2017 05:55 — forked from hissy/gist:3613306
[WordPress] change next / previous post link ordering
<?php
/**
* Customize Adjacent Post Link Order
*/
function my_custom_adjacent_post_where($sql) {
if ( !is_main_query() || !is_singular() )
return $sql;
$the_post = get_post( get_the_ID() );
$patterns = array();
@1wdtv
1wdtv / child-theme-functions-php-snippet.php
Created February 28, 2017 01:02 — forked from lots0logs/child-theme-functions-php-snippet.php
WordPress :: Divi Theme :: Disable Default Open Sans Font
<?php
/* DON'T copy the first line (above) if your functions.php already has it.
* ---------------------------------------------------------------------- */
function et_divi_fonts_url() {
$fonts_url = '';
/* Translators: If there are characters in your language that are not
* supported by Open Sans, translate this to 'off'. Do not translate
* into your own language.
*/
@1wdtv
1wdtv / use-plugin-to-override-woocommerce.php
Created June 22, 2016 19:24
Use plugin to override woocommerce template files (instead of child theme)
// modify default wc template override so it uses our plugin templates instead
// https://www.skyverge.com/blog/override-woocommerce-template-file-within-a-plugin/
function lab_flavor_plugin_path() {
// gets the absolute path to this plugin directory
return untrailingslashit( plugin_dir_path( __FILE__ ) );
}
add_filter( 'woocommerce_locate_template', 'lab_flavor_woocommerce_locate_template', 10, 3 );
function lab_flavor_woocommerce_locate_template( $template, $template_name, $template_path ) {
global $woocommerce;
@1wdtv
1wdtv / index.html
Created February 5, 2016 16:37
module0001
<section id="module0001">
<div class="container">
<div class="row">
<div class="col-md-6">
<!--Left Column-->
<div class="row">
<div class="title-block">
<h1>ELEMENT WATCHES</h1>
<h1>lorum ipsum deloras con squetor della con </h1>
</div>