Skip to content

Instantly share code, notes, and snippets.

@nternetinspired
nternetinspired / gist:7482445
Last active February 24, 2022 17:20
Load Disqus comments only on demand if you give a shit about page weight and your visitors. Even with no comments, i.e. an empty comment form, calling Disqus will load an extra 226Kb. If your page has comments this can be far higher. This Gist accompanies my blog post: http://internet-inspired.com/wrote/load-disqus-on-demand/
// Requires jQuery of course.
$(document).ready(function() {
$('.show-comments').on('click', function(){
var disqus_shortname = 'YOUR-DISQUS-USERNAME'; // Replace this value with *your* username.
// ajax request to load the disqus javascript
$.ajax({
type: "GET",
url: "http://" + disqus_shortname + ".disqus.com/embed.js",
dataType: "script",
@Miq3l
Miq3l / functions.php
Last active June 22, 2021 14:15 — forked from SiR-DanieL/functions.php
Adding VAT to WooCommerce
/***************************** FRONTEND ****************************************/
/**************************
Filter to add a VAT field to:
- My Account - Edit Form -- Billing fields
- Checkout - Edit Form - Billing Fields
This function is also reordering the form fields
@IsraelOrtuno
IsraelOrtuno / dropdown-megamenu.scss
Last active May 2, 2019 09:09
Bootstrap 4 Megamenu dropdown
// Mega menu canvas
.dropdown--canvas {
// Reset margin and padding
.dropdown-menu {
left : auto;
padding : 0;
margin : 0;
}