WordPress Question:

How to use time ago function on wordpress posts?

Tweet Share WhatsApp

Answers:

Answer #1<!---------------add code in function.php ------------------>
<?php
add_filter( \'the_content\', \'time_ago\' );

function time_ago ( $content ) {

$content .= \"
\" . __( \'Posted \', \'test\' ) . human_time_diff( get_the_time(\'U\'), current_time(\'timestamp\') ) . __( \' ago\', \'test\' );

return $content;

}
?>

Answer #2Please remove all '/' this.

Download WordPress (CMS) PDF Read All 32 WordPress (CMS) Questions
Previous QuestionNext Question
How to create plugin for wordpress?What is WordPress?