Skip to content

Instantly share code, notes, and snippets.

@skipshean
skipshean / remove-wc-sidebar-divi
Created December 21, 2016 02:38
Remove the sidebar in Divi theme WooCommerce pages
/*=====[ Divi Theme hide sidebar on WooCommerce product and shop pages ]=====*/
.woocommerce-page #left-area {
padding-right: 0 !important;
width: 100%;
}
.woocommerce-page #sidebar {
display: none;
}
.woocommerce-page #main-content .container::before {
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Your Page</title>
<meta http-equiv="refresh" content="0;URL='http://URLexample.com/'" />
</head>
<body>
<p>This page has moved to a <a href="http://URLexample.com/">
URLexample.com</a>.</p>
</body>
</html>
@skipshean
skipshean / parse-email.js
Created May 7, 2018 18:26
Parse email address from URL parameter = email
<!-- Parse email address from URL parameter = email -->
<script>
var mail = document.querySelector('input#email_address');
if (mail) {
var t = document.location.href.split('?')[1];
if (t) {
var params = {};
var lst = t.split('&'), l = lst.length;
for (var i = 0; i < l; i++) {
var p = lst[i].split('=');
@skipshean
skipshean / async-js.php
Created August 30, 2018 18:25
Load Wordpress jQuery asynchronously - insert in WP functions.php file
/*Function to defer or asynchronously load scripts*/
function js_async_attr($tag){
# Do not add defer or async attribute to these scripts
$scripts_to_exclude = array('jquery.js', 'script2.js', 'script3.js');
foreach($scripts_to_exclude as $exclude_script){
if(true == strpos($tag, $exclude_script ) )
return $tag;
}
@skipshean
skipshean / dark-mode.html
Created April 21, 2022 14:57
Dark Mode snippet for emails
<!-- Source: https://litmus.com/community/snippets/233-dark-mode-support -->
<!-- Put both of these sections in the <head> of your email. -->
<!-- Enable Dark Mode Support -->
<meta name="color-scheme" content="light dark">
<meta name="supported-color-schemes" content="light dark only">
<style type="text/css">
:root {
color-scheme: light dark;