Skip to content

Instantly share code, notes, and snippets.

View Vesymos's full-sized avatar

Vasyl Moshchenko Vesymos

  • Zhytomyr, Ukraine
View GitHub Profile
@Vesymos
Vesymos / functions.php
Created November 11, 2014 10:48
Display how long ago a comment, post or item was published. From: https://kopepasah.com/tutorial/display-how-long-ago-a-comment-post-or-item-was-published/ Usage: <?php get_time_difference( $comment->comment_date ); ?>
<?php
/**
* Return a time difference of a given time in
* days, hours or minutes depending on the time
* difference.
*
* @param $time (required)
*/
function get_time_difference( $time ) {
$current_time = new DateTime( current_time( 'mysql' ) );
<?php
global $current_user;
get_currentuserinfo();
echo get_avatar( $current_user->ID, 128 );
?>
function new_excerpt_length($length) {
return 200;
}
add_filter('excerpt_length', 'new_excerpt_length');
Twitter
http://twitter.com/home?status=[TITLE]+[URL]
Digg
http://www.digg.com/submit?phase=2&url=[URL]&title=[TITLE]
Facebook
http://www.facebook.com/share.php?u=[URL]&title=[TITLE]
StumbleUpon