Type: js
Google tag
Lenis Smooth scroll JS
MemberPress: Change Username Field’s Placeholder and/or Label of the Field on Login Page
document.addEventListener(‘DOMContentLoaded’, function() { // Select the input element by its id var usernameInput = document.getElementById(‘user_login’); // Check if the element exists to avoid any potential JavaScript errors if (usernameInput) { // Change the placeholder text usernameInput.placeholder = ‘Username or Email’;…Continue reading
NextGEN – Set pagination links as nofollow to exclude then from the sitemap
document.querySelectorAll(‘.ngg-navigation a’).forEach(link => { link.setAttribute(‘rel’,’nofollow’); });Continue reading
Soliloquy – Hide the caption’s shadow
const captionDivs = document.querySelectorAll(‘.soliloquy-caption-inside’); captionDivs.forEach(div => { if (div.textContent.trim() === ”) { div.style.display = ‘none’; }});Continue reading
NextGEN Pro Ecommerce – Move the “Digital Downloads” items to the top of the list in the ecommerce sidebar.
jQuery(document).ready(function() { function executeJS() { jQuery(document).ready(function($) { var $h3 = $(‘#ngg_category_digital_downloads’).prev(‘h3’); var $targetElement = $(‘#ngg_category_digital_downloads’); var $newContainer = $(‘ ‘).append($h3).append($targetElement); $(‘.nggpl-pricelist_category_wrapper’).prepend($newContainer); }); } jQuery(document).on(‘ajaxComplete’, function(event, xhr, settings) { if (settings.url.indexOf(‘GetSidebarData’) !== -1) { executeJS(); } }); if (jQuery(‘#npl_wrapper’).hasClass(‘npl-sidebar-open’)) { executeJS();…Continue reading
NextGEN Pro – Fix an issue with the Mosaic, Masonry or Tile gallery failing to display when added to a Visual Composer Tab module
jQuery(‘.vc_tta-panel-title’).click(function(){ jQuery(window). trigger(‘resize’); });Continue reading
Envira [Featured Content Addon] – Apply the custom link to the captioned text on hover
jQuery(document).ready(function($) { var captions = $(‘.envira-gallery-captioned-text’); captions.each(function() { var caption = $(this); var item = caption.closest(‘.envira-gallery-item’); var link = item.find(‘.envira-gallery-link-disabled’); if (link.length) { caption.wrap(‘‘); }});});Continue reading
NextGEN Pro [Ecommerce] Hide the empty cart (both WooCommerce’s and NextGEN”s)
function hideElements() { const noItemsElements = document.querySelectorAll(‘#ngg_pro_no_items’); noItemsElements.forEach((noItems) => { const proCheckout = noItems.closest(‘#ngg_pro_checkout’); if (proCheckout) { proCheckout.style.display = ‘none’; } }); const cartEmptyMessages = document.querySelectorAll(‘.wc-empty-cart-message’); cartEmptyMessages.forEach((message) => { const parent = message.closest(‘.woocommerce’); if (parent) { parent.style.display = ‘none’; }…Continue reading