- This topic has 22 replies, 2 voices, and was last updated 2 years, 3 months ago by
David.
-
AuthorPosts
-
January 8, 2020 at 12:02 am #1125307
Franklin
Hi,
I have added the CSS to show the Last Updated text and the Last modified date for the post.But if the post is not modified yet then it should show Published date with the same text: Last Updated
Sample URL: https://spydrill.com/mspy-review/
As it is not modified hence nothing shows up. I want that Last Updated text should be shown with published date in case modified time is missing.
Thanks.
January 8, 2020 at 5:07 am #1125482David
StaffCustomer SupportHi there,
this article provides the PHP snippet to output only the updated date if one exists, if it not it displays the published date:
https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 10, 2020 at 3:04 am #1127621Franklin
I added the code from the link provided by you.
It removed the link from the date but the published date is still not coming if modified date is not present.
January 10, 2020 at 4:11 am #1127673David
StaffCustomer SupportYou need to remove the CSS you added to hide the published date.
If you want to add labels e.g Published on and Last Updated then we can help edit the code in the link i provided to do that.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 10, 2020 at 8:36 pm #1128470Franklin
On doing that, two dates are coming for the posts that have both published and modified date.
In this case, only modified date must appear.
Sample URL: https://spydrill.com/mspy-vs-spyzie/
Also, we want the “Last Updated” text even when the published date is shown.
sAMPLE url: https://spydrill.com/mspy-review/
January 11, 2020 at 1:21 am #1128558David
StaffCustomer SupportIf you remove any previous code (PHP or CSS) and only apply what i provided here then there should only be the single date displayed.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 11, 2020 at 1:34 am #1128566Franklin
Thanks, it works. Now how to get the “Last Updated” text.
January 11, 2020 at 2:05 am #1128582David
StaffCustomer SupportChange this line of code:
return sprintf( '<span class="posted-on">%s</span> ',
to:
return sprintf( '<span class="posted-on">Last Updated: %s</span> ',
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 11, 2020 at 2:19 am #1128603Franklin
Thank you, David, for making it work for me!
January 11, 2020 at 3:06 am #1128617David
StaffCustomer SupportYou’re very welcome
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 16, 2020 at 10:28 pm #1134679Franklin
Hi David,
The article even modified shows the published date.
Sample URL: https://spydrill.com/cell-phone-spy-app-buying-guide/
It is modified on 17th Jan but it shows published date 8th Jan.
Please help!
January 17, 2020 at 4:30 am #1134898David
StaffCustomer SupportAre you using JUST the code i provided here as all of your posts are still displaying both dates which they shouldn’t be. Let me know,
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 17, 2020 at 5:15 am #1134938Franklin
Hi David,
Please check the screenshot. I see only one date.
January 17, 2020 at 11:24 am #1135452Tom
Lead DeveloperLead DeveloperThe other date is hidden with CSS.
Can you share the exact function you’re using right now?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJanuary 17, 2020 at 9:08 pm #1135696Franklin
There were repeat lines in my code. Fixed it.
Sorry for bothering you!
Thanks,
Hemant -
AuthorPosts
- You must be logged in to reply to this topic.