Created
February 16, 2015 02:39
-
-
Save Aziz-Rahman/56ec268fa759d2abe290 to your computer and use it in GitHub Desktop.
To Display meta
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 | |
/** | |
* Function to display post meta | |
* | |
* @package WordPress | |
* @subpackage My Theme | |
* @since My Theme 1.0.0 | |
*/ | |
if ( ! function_exists( 'my_post_meta' ) ) { | |
function my_post_meta() { | |
global $post; | |
$author = '<a href="' . get_author_posts_url($post->post_author) . '">' . get_the_author() . '</a>'; | |
$time = sprintf( __('%s ago', 'mytheme1'), human_time_diff( get_the_time('U'), current_time('timestamp') ) ) ; | |
?> | |
<div class="meta"> | |
<span><i class="fa fa-child"></i> <?php _e('Posted by', 'mytheme1'); ?> <?php echo $author; ?></span> | |
<span><i class="fa fa-calendar"></i> <?php echo date_i18n('M jS, Y'); ?></span> | |
<span><i class="fa fa-clock-o"></i> <?php echo $time; ?></span> | |
</div> | |
<?php | |
} | |
} | |
?> | |
<!-- Untuk pemanggilan --> | |
<?php my_post_meta(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment