Skip to content

Instantly share code, notes, and snippets.

View gregogalante's full-sized avatar
✌️
What's happening?

Gregorio Galante gregogalante

✌️
What's happening?
View GitHub Profile
@gregogalante
gregogalante / WpPolylangCopyPosts.php
Last active February 12, 2016 13:15
Permette di copiare titolo e contenuto di un post da una lingua all'altra attraverso i comandi di duplicazione di Polylang. Codice da inserire nel function.php
<?php
// Make sure Polylang copies the content when creating a translation
function jb_editor_content( $content ) {
// Polylang sets the 'from_post' parameter
if ( isset( $_GET['from_post'] ) ) {
$my_post = get_post( $_GET['from_post'] );
if ( $my_post )
return $my_post->post_content;
}
@gregogalante
gregogalante / AnimatedCounter.js
Last active February 12, 2016 13:15
Animazione di sviluppo numeri di un contatore numerico.
var animateCounters = function(duration) {
var $count = $('.counter');
if($count.length) {
$count.each(function () {
$(this).prop('Counter',0).animate({
Counter: $(this).attr('count-number')
}, {
duration: duration,
easing: 'swing',