Skip to content

Instantly share code, notes, and snippets.

@infocities
infocities / gw-gravity-forms-submission-limit.php
Created June 30, 2022 15:41 — forked from spivurno/gw-gravity-forms-submission-limit.php
Gravity Wiz // Gravity Forms // Limit Submissions Per Time Period (by IP, User, Role, Form URL, or Field Value)
<?php
/**
* Gravity Wiz // Gravity Forms // Limit Submissions Per Time Period (by IP, User, Role, Form URL, or Field Value)
*
* Limit the number of times a form can be submitted per a specific time period. You modify this limit to apply to
* the visitor's IP address, the user's ID, the user's role, a specific form URL, or the value of a specific field.
* These "limiters" can be combined to create more complex limitations.
*
* @version 3.0
* @author David Smith <david@gravitywiz.com>
function default_category_featured_image() {
global $post;
$featured_image_exists = has_post_thumbnail($post->ID);
if (!$featured_image_exists) {
$attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );
if ($attached_image) {
foreach ($attached_image as $attachment_id => $attachment) {
<?php
class WPLazyLoadImages {
function __construct() {
// Add Our Filters and actions for the plugin
add_action('wp_enqueue_scripts', array($this, 'enqueue_lazyload'));
add_filter('the_content', array($this, 'filter_lazyload'));
add_action('wp_footer', array($this, 'footer_lazyload'));
<div class="youtube" data-embed="37FJQ9kpbIE">
<div class="play-button"></div>
</div>
.youtube {
background-color: #000;
margin-bottom: 30px;
position: relative;
padding-top: 56.25%;
overflow: hidden;
cursor: pointer;
}
.youtube img {
width: 100%;
@infocities
infocities / divi_video_preload.js
Created June 30, 2022 15:18 — forked from eduard-un/divi_video_preload.js
Js code for preloading Youtube Videos in Divi
( function() {
setTimeout( function() {
var youtube = document.querySelectorAll( ".youtube" );
for ( var i = 0; i < youtube.length; i++ ) {
var source = "https://img.youtube.com/vi/" + youtube[ i ].dataset.embed + "/sddefault.jpg";
var image = new Image();
image.src = source;
@infocities
infocities / fix-mobile-ment.md
Created May 21, 2022 23:23 — forked from imuhammadshoaib/fix-mobile-ment.md
Add Clickable functioanlities to Divi Collapsing Nested Menu Items

Thank you Stefano Mortellaro for the code!

<style type="text/css">
#main-header .et_mobile_menu .menu-item-has-children > a { background-color: transparent; position: relative; }
#main-header .et_mobile_menu .menu-item-has-children > a:after { font-family: 'ETmodules'; text-align: center; speak: none; font-weight: normal; font-variant: normal; text-transform: none; -webkit-font-smoothing: antialiased; position: absolute; }
#main-header .et_mobile_menu .menu-item-has-children > a:after { font-size: 16px; content: '\4c'; top: 13px; right: 10px; }
#main-header .et_mobile_menu .menu-item-has-children.visible > a:after { content: '\4d'; }
#main-header .et_mobile_menu ul.sub-menu { display: none !important; visibility: hidden !important;  transition: all 1.5s ease-in-out;}
#main-header .et_mobile_menu .visible > ul.sub-menu { display: block !important; visibility: visible !important; }
</style>
@infocities
infocities / DiviNav.js
Created May 21, 2022 23:23 — forked from imuhammadshoaib/DiviNav.js
DIVI nav js
<script>
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 200 || document.documentElement.scrollTop > 200) {
document.getElementById("navobar").style.top = "0";
document.getElementById("navobar").style.display = "block";
} else {
@infocities
infocities / gist:3539c0fa63bb0462d2b8cb5d32f5591c
Created May 21, 2022 23:07 — forked from ashlie-elizabeth-moore/gist:76f15fdad828e9f2eb7cd7423fa71ba6
Divi Theme Builder Fix - Stop words in Headers from wrapping ( The builder default)
/* Header Fix --> Makes Long Words Break */
h1, h2, h3, h4, h5, h6 {
overflow-wrap: break-word;
}