• Resolved Chris.V

    (@chrisv234)


    Hi,

    How can I display the post published date for every post on the post archive page?

    The theme by default shows the published post date on single-post pages but it does not offer an option to do so on the archive page as well.

    Is there an option I missed out? If not, can you provide some script/snippet to do so?

    Regards,

    Chris

    • This topic was modified 1 year, 4 months ago by Chris.V.
Viewing 1 replies (of 1 total)
  • Thread Starter Chris.V

    (@chrisv234)

    Hi @victorsun2018, thanks for the reply. However, on the project I am working on the creation of a child theme only to implement your solution it is not recommended. I used the following script to solve the problem without the creation of a child theme.

    function my_custom_excerpt_read_more_link( $output ) {
    	global $post;
    	return $output . '<span class="dynami-politon-post-date">Published on ' . get_the_date('j F Y', get_the_ID()) . '</span>' . '<a href="' . get_permalink( $post->ID ) . '" class="custom-read-more">Read More</a>';
    }
    add_filter( 'the_excerpt', 'my_custom_excerpt_read_more_link' );
Viewing 1 replies (of 1 total)
  • The topic ‘How to display post published date on post archive page’ is closed to new replies.