Archived topic
remove publish date onsite - I looked at a few threads recently already
5 replies · Started by Mary on November 18, 2020
Hi,
I was to remove the publish date on my blog post and show only the update date. I found your article on how to do it in CSS but it didn't quite work.
This is the code I was supposed to add:
add_filter( 'generate_post_date_show_updated_only', '__return_true' );
Right now, this is my CSS look like:
.posted-on .updated {
display: inline-block;
margin-right: 15px;
}
.posted-on .updated:before {
content: "LAST UPDATED: ";
}
.posted-on .published:before {
content: "PUBLISHED ON: ";
}
----------
I tried removing this part:
}
.posted-on .updated:before {
content: "LAST UPDATED: ";
}
.posted-on .published:before {
content: "PUBLISHED ON: ";
}
to replace with the code earlier but it only removed the words "LAST UPDATED and PUBLISHED ON". Both dates are still showing. Here's a screenshot: https://prnt.sc/vljmxq
Thank you!
Mary
Hi there,
can you provide a link to your site where i can see the issue?
Hi David,
Sure, I added it on the private information form. I am back to my original CSS and didn't add the new one yet:
.posted-on .updated {
display: inline-block;
margin-right: 15px;
}
.posted-on .updated:before {
content: "LAST UPDATED: ";
}
.posted-on .published:before {
content: "PUBLISHED ON: ";
}
.entry-content ul {
margin-left: 3em !important;
}
@media (min-width: 769px) {
.navigation-search.nav-search-active {
left: 0%;
width: auto;
}
}
This code is PHP:
add_filter( 'generate_post_date_show_updated_only', '__return_true' );
Remove it from your CSS, and follow this article that explains how to add it:
Hi David,
Thanks for the help, I also found another solution in CSS if anyone in the future read this thread:
.entry-meta .entry-date.published {
display: none;
}
Or you can try the below CSS codes.
.entry-meta {
display: none;
}
Glad to hear that !