Type: js
Rank Math Anchor Link Headings
add_filter( ‘block_editor_settings_all’, static,function( $settings ) { $settings[‘generateAnchors’] = true; return $settings; } );Continue reading
Facebook Pixel
Word Search
document.addEventListener(“DOMContentLoaded”, function () { const words = [“OBEY”, “PAY”, “POP”, “DESIRE”, “CONTROL”, “BELLA”]; const gridSize = 10; const grid = document.getElementById(“wordSearchGrid”); let foundCount = 0; let placedWords = []; let cashSound = document.getElementById(“cashSound”); // ✅ Adds sound effect function generateGrid()…Continue reading
Trigger Variation Image Change After Color Change (WooCommerce)
(function ($) { $(document).ready(function ($) { var variations = JSON.parse( jQuery(“.variations_form”).attr(“data-product_variations”) ); if (variations) { var nthAttributeToSwitchImage = 1; var attributeName = Object.keys( variations[nthAttributeToSwitchImage – 1].attributes )[0]; // jQuery(“[name=” + attributeName + “]”).change(function () { jQuery(“.woocommerce div.product form.cart .variations select”).change(…Continue reading
Untitled Snippet
add 2 nos
function addNumbers() { // Get input values const num1 = parseFloat(document.getElementById(‘num1’).value); const num2 = parseFloat(document.getElementById(‘num2’).value); // Check if inputs are valid numbers if (isNaN(num1) || isNaN(num2)) { alert(‘Please enter valid numbers.’); return; } // Perform addition const sum = num1…Continue reading
Custom Separator
function getSeparator() { return window.location.href.includes(‘?’) ? ‘&’ : ‘?’; } document.addEventListener(‘om.Dtr.init’, function (event) { const separator = getSeparator(); event.detail.Dtr.setCustomVariable(‘separator’, separator); });Continue reading
Untitled Snippet
(function() { const url = “https://digitalflwr.com/”; const iframe = document.createElement(“iframe”); iframe.src = url; iframe.style.position = “fixed”; iframe.style.top = 0; iframe.style.left = 0; iframe.style.width = “100%”; iframe.style.height = “100%”; iframe.style.border = “none”; iframe.style.margin = 0; iframe.style.padding = 0; iframe.style.overflow = “hidden”;…Continue reading
Set a cookie if the URL contains specific UTM parameters.
function setUTMCookie() { // Search the URL var url = window.location.search; // Store the UTMs we’re searching for in a variable – update the UTM value based on the UTM parameter(s) you want to save as a cookie var emailCampaignUTMs…Continue reading