added function for display date in single item collection

This commit is contained in:
Fabiano 2018-05-29 09:56:38 -03:00
parent 7ef42b2751
commit 0db9ba4500
2 changed files with 5 additions and 5 deletions

View File

@ -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 ) {

View File

@ -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>