Archived topic
Remove Post Dates On Selected Posts Only
5 replies · Started by JOHN on February 14, 2019
What is the correct way to remove posts dates only on a few posts?
I am using the "marketer" theme library.
I use mostly posts and a few pages on my site. A few of my posts I would like the date not to show.
I have read in the forum of using CSS or using a filter.
What would you recommend?
Hi there,
if you don't want ( or don't mind ) search engines not seeing the date then filter is the best route. Tom provides a filter here for posts that are within particular categories as an example:
https://generatepress.com/forums/topic/disable-post-meta-based-on-category/#post-721411
If you want to allow the search engine to see the date but not humans then CSS. Let me know.
How would I do it with CSS?
Would this work?
.entry-date {
display: none;
}
I just want to hide the date on 3 posts.
You would do this:
.postid-10 .posted-on,
.postid-20 .posted-on,
.postid-30 .posted-on {
display: none;
}
You just need to update numbers with the actual IDs of the posts.
Thank you. that works.
You're welcome :)