added function for display date in single item collection
This commit is contained in:
parent
7ef42b2751
commit
0db9ba4500
|
@ -58,9 +58,9 @@ add_filter( 'comment_text', 'wrap_Comment', 99);
|
|||
/**
|
||||
* Display date of post.
|
||||
*/
|
||||
if ( ! function_exists( 'tainacan_post_date' ) ) {
|
||||
//if ( ! function_exists( 'tainacan_post_date' ) ) {
|
||||
function tainacan_post_date() {
|
||||
if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) {
|
||||
//if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) {
|
||||
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
|
||||
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
||||
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time> <time class="updated" datetime="%3$s">(updated %4$s)</time>';
|
||||
|
@ -72,9 +72,9 @@ if ( ! function_exists( 'tainacan_post_date' ) ) {
|
|||
get_the_modified_date()
|
||||
);
|
||||
echo $time_string;
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
// define the cancel_comment_reply_link callback
|
||||
function filter_cancel_comment_reply_link( $formatted_link, $link, $text ) {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<header class="mb-4">
|
||||
<div class="header-meta text-muted mb-5">
|
||||
<?php _e('By ', 'tainacan-theme'); the_author_posts_link(); ?>
|
||||
<span class="time"><strong><?php _e('Send date', 'tainacan-theme'); ?>:</strong> <time>22/05/2018</time></span>
|
||||
<span class="time"><strong><?php _e('Send date', 'tainacan-theme'); ?>:</strong> <?php tainacan_post_date(); ?></span>
|
||||
</div>
|
||||
<?php //the_post_thumbnail(); ?>
|
||||
</header>
|
||||
|
|
Loading…
Reference in New Issue