himanshu Dhingra
asked 6 years ago

Hello, I need to add a time stamp in the format of “2 hours ago” “2 days ago” “2 min ago” like this to each post.

Is there any way?

And in a previous question I asked to remove comment and read more tag from post, you solved my issue, But the empty white space which it was taking is still not cropped.
Actually i made those element to remove because i want my post to be as small in size as possible.

Please help in both the problems if possible.

Waiting for positive reply.

himanshu Dhingra
replied 6 years ago

Sir please answer this question.Waiting for your positive response. 🙂

1 Answers
answered 6 years ago

To resolve this issue, you can open the content.php file in the folder path “wp-content\themes\dw-wallpress”.
Find the line 52 then add the following code under 52.

<?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago'; ?>

– You can add the following code to remove the “Comment, Read more “:

.post .meta-bottom { display: none; }

Hope this helps !

Helena Liu
replied 5 years ago

This timestamp was exactly what I was looking for. Thank you!

Powered by DW Question & Answer Pro