Skip to content

Instantly share code, notes, and snippets.

https://br.wordpress.org/plugins/post-expirator/
/* top spacing above anchor links*/
body:not(.elementor-editor-active) .elementor-menu-anchor:before {
content: "";
display: block;
height: 70px;
margin: -70px 0 0;
visibility: hidden;
pointer-events: none;
}
<style>
.cabecalho {
width: 100%;
text-align: center;
color: orangered;
}
.cabecalho:hover {
color: blue;
cursor: grab;
@LeoLopesWeb
LeoLopesWeb / .php
Last active September 22, 2023 19:53
/**/
function time_ago() {
return __( 'há' ).' '. human_time_diff( get_the_time( 'U' ), current_time( 'timestamp' ) );
}
@LeoLopesWeb
LeoLopesWeb / .php
Last active September 22, 2023 19:52
/**/
function get_reading_time() {
$article = get_post_field( 'post_content', get_the_ID() );
$wordcount = str_word_count( strip_tags( $article ) );
$time = ceil($wordcount / 250);
if ($time == 1) {
$label = " minuto";
} else {
$label = " minutos";
$(document).on("click", function(event) {
var obj = $("#container");
if (!$(event.target).closest(obj).length) {
alert("Outside click detected!");
}
else {
alert("Inside click detected!");
}
});
@LeoLopesWeb
LeoLopesWeb / .js
Last active September 9, 2023 22:21
// click item to #tab scroll
let tabitem = document.querySelectorAll('#tabs li');
tabitem.forEach(function (el) {
el.addEventListener('click', function (event) {
document.getElementById("tabs").scrollTo({
top: 0,
left: el.offsetLeft,
behavior: "smooth",
});
}, false);
https://codepen.io/aelong/pen/JEjBeN
<!-- no modo 'percentPosition'ele usa o width do item no css para estipular a largura das colunas -->
<script src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js"></script>
<script>
$('.col-lista-termos').masonry({
gutter: 32,
itemSelector: '.item',
percentPosition: true,
//horizontalOrder: true,
});
$("#pix-qrcode .button").click(function () {
var value = $("#getpix").val();
var $temp = $("<input>");
$("body").append($temp);
$temp.val(value).select();
document.execCommand("copy");
$temp.remove();
});