This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//from here https://gomakethings.com/how-to-test-if-an-element-is-in-the-viewport-with-vanilla-javascript/ | |
//NOTE: This script return true when ALL element is in the viewport, not only its part | |
var isInViewport = function (elem) { | |
var bounding = elem.getBoundingClientRect(); | |
return ( | |
bounding.top >= 0 && | |
bounding.left >= 0 && | |
bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) && | |
bounding.right <= (window.innerWidth || document.documentElement.clientWidth) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function printed_el_text( el ){ | |
var text = el.innerHTML, | |
i = 0, | |
__print = function (){ | |
i++; | |
if( i <= text.length ){ | |
el.innerHTML = text.substr(0, i); | |
setTimeout( __print, 20 ); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on("keypress", ":input:not(textarea)", function(event) { | |
return event.keyCode != 13; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo mb_strimwidth(get_sub_field('title'), 0, 50, '...'); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
if(!sessionStorage.getItem('isshow')){ | |
// here run code for animation that will fire only on first visit | |
sessionStorage.setItem('isshow', true); | |
} | |
}); | |
//https://stackoverflow.com/questions/32155036/show-jquery-popup-only-at-first-visit-of-a-page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$project_3_works_bg_color = get_field('works-bg-color', $post->ID); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Custom excerpt | |
function excerpt($limit, $morelink) { | |
$excerpt = explode(' ', get_the_excerpt(), $limit); | |
if (count($excerpt) >= $limit) { | |
array_pop($excerpt); | |
$excerpt = implode(" ", $excerpt) . $morelink; | |
} else { | |
$excerpt = implode(" ", $excerpt); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp_options > siteurl | |
wp_options > home | |
For local: http://localhost/yoursitefolder or http://yourlocalip/yoursitefolder | |
Always clear cache in browser! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getRndmFromSet(set) | |
{ | |
var rndm = Math.floor(Math.random() * set.length); | |
return set[rndm]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ol { | |
list-style: none; | |
counter-reset: item; | |
} | |
li { | |
counter-increment: item; | |
margin-bottom: 5px; | |
} | |
li:before { | |
margin-right: 10px; |