Created
July 27, 2016 15:10
-
-
Save MatRouault/ebb974efb79444d20f465344ac8ac698 to your computer and use it in GitHub Desktop.
Change the post meta date/time to human difference format.
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 | |
//https://community.getbeans.io/discussion/pretty-date/#post-1975 | |
// Change the post meta date prefix. | |
add_filter( 'beans_post_meta_date_prefix_output', 'example_post_meta_date_prefix' ); | |
function example_post_meta_date_prefix() { | |
echo 'Posted: '; | |
} | |
// Change the post meta date/time to human difference format. | |
add_filter( 'beans_post_meta_date_text_output', 'example_post_meta_date_text' ); | |
function example_post_meta_date_text() { | |
echo human_time_diff( get_the_time( 'U' ) ) . ' ago'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment