- This topic has 3 replies, 2 voices, and was last updated 7 years, 1 month ago by Mahesh.
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
February 22, 2017 at 5:55 pm #110474FalkR1979Participant
Hi there,
wondering if it’s possible to display the time when a post was published in the articles entry-meta.
If it is: how can it be realized?
February 23, 2017 at 9:41 am #110513MaheshKeymaster@falkr1979: Yes, this can be done. For that, you’ll need to create a child theme. You can find more details on creating child theme HERE. Then in your child theme’s
functions.php
add the following codes.function catchevolution_posted_on() { /* Check Author URL to Support Google Authorship * * By deault the author will link to author archieve page * But if the author have added their Website in Profile page then it will link to author website */ if ( get_the_author_meta( 'user_url' ) != '' ) { $catchevolution_author_url = esc_url( get_the_author_meta( 'user_url' ) ); } else { $catchevolution_author_url = esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ); } printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date updated" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'catch-evolution' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date( 'F j, Y g:i A' ) ), $catchevolution_author_url, esc_attr( sprintf( __( 'View all posts by %s', 'catch-evolution' ), get_the_author() ) ), get_the_author() ); }
Regards,
MaheshFebruary 24, 2017 at 2:31 pm #110587FalkR1979ParticipantThumbs up! That did the job. Just had to implement some adjustments due to localization.
Thank you !!!
February 26, 2017 at 1:09 pm #110706MaheshKeymaster@falkr1979: Thank you for your appreciation. Have a nice day!
Regards,
Mahesh -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- The topic ‘publishing time in entry-meta’ is closed to new replies.