Archived topic
Wanting date ONLY on blog
7 replies · Started by robmac on February 1, 2016
Greetings,
Does anyone happen to know any easy way, to REMOVE the date, from posts OTHER than my actual blog? Is there a plugin that will assist, or, would I have to code it, please? Thank you for any guidance offered.
ie,
"My Blog" [date to REMAIN]
posts - category A [Wanting to REMOVE date on posts]
posts - category B [Wanting to REMOVE date on posts]
etc
etc
Thank you.
Hi there,
The Blog add-on allows you to remove it from all posts and your blog in the Customizer.
To remove it only within categories, you'll need to use the available filters with an is_category() conditional.
I'm away from my desktop right now but can give you some example code as soon as I'm back if you need?
Let me know :)
Hi there,
Give this a shot:
add_filter( 'generate_post_date','generate_change_date_display' );
function generate_change_date_display()
{
if ( is_home() ) {
return true;
}
return false;
}
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
Tom,
Sorry for delay in replying.
Sincere thanks, as ever, for your very helpful support.
Robert
Hi Tom,
What I found works best, for what I want to do is, [with my child theme active] adding to "Simple CSS" the following:
.entry-meta {display: none;} it removes the date and author from all my posts. However, it also does from my blog, could please suggest some code I could add to the above CSS to exempt a specific category, please?
Thank you.
Regards,
Robert
You can hide it from categories with this:
.category .entry-meta {
display: none;
}
You can do specific categories with this:
.category-categoryname .entry-meta {
display: none;
}
Thanks again, seems to have worked fine!
Awesome :)
