JS Code SnippetOn the page you want this to appear, add an HTML widget (FREE) and paste the code in there. Be sure to have before your code and after the code if it isn't already inserted above.
Instructions
Change if (clickCount > 1) { to however many clicks you want.
Change window.location.href = 'https://voxel.guide/login-registration/'; to your login URL.
<script> document.addEventListener('DOMContentLoaded', function () { // Check if the user is logged in // This checks for a specific class on the body tag which is common in WordPress const userLoggedIn = document.body.classList.contains('logged-in');
if (!userLoggedIn) { const loadMoreButton = document.querySelector('.ts-load-more'); const storageKey = 'loadMoreClickCount'; let clickCount = parseInt(localStorage.getItem(storageKey)) || 0;
loadMoreButton.addEventListener('click', function () { clickCount++; localStorage.setItem(storageKey, clickCount);