JavaScript for Craft Picker

// Menu Toggle function toggleMenu() { const mobileNav = document.querySelector(‘.mobile-nav’); mobileNav.classList.toggle(‘active’); } // Close Menu on Scroll function closeMenuOnScroll() { const mobileNav = document.querySelector(‘.mobile-nav’); if (mobileNav.classList.contains(‘active’)) { mobileNav.classList.remove(‘active’); } } // Attach the scroll event listener window.addEventListener(‘scroll’, closeMenuOnScroll); // Show…Continue reading

CSS For Craft Picker

/* General Styles */ body { margin: 0; font-family: ‘Arial’, sans-serif; background-color: #f9f9f9; color: #333; line-height: 1.6; } /* Header Styles */ .header { background-color: #ffe4e1; text-align: center; padding: 20px 10px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); }…Continue reading

MemberPress: Add a Shortcode To Display the Number of Total Downloads for All Files

add_shortcode( ‘mepr-display-total-downloads’, function() { global $wpdb; $downloads_old = $wpdb->get_var( “SELECT SUM(download_count) FROM {$wpdb->prefix}mpdl_file_downloads” ); $downloads_new = $wpdb->get_var( “SELECT count(*) FROM {$wpdb->prefix}mpdl_file_stats” ); $downloads_old = isset( $downloads_old ) && $downloads_old != null ? $downloads_old : 0; $downloads_new = isset( $downloads_new )…Continue reading