-
erickimani
Hi, The published date is what is showing on my posts. I would like modifed date to be what shows.
How can i achieve this?
-
Fernando
Hi Erickimani,
It depends on how your Date is being outputted on your site. For reference, can you provide the link to the site in question so we can assess what needs to be done?
-
erickimani
constructionreviewonline.com
-
Fernando
I see. You can try adding the snippet here: https://docs.generatepress.com/article/generate_post_date_show_updated_only/
Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
-
erickimani
Thanks!
Its worked
-
Fernando
You’re welcome, Erickimani!
-
erickimani
How can I have the news posts that are in a specific category called news show the published date while other posts show the modified date
-
In that case, you would need to add some conditions to the filter, try change it to:
function custom_post_date_display( $show_updated_only ) { global $post; // Check if the post is assigned to the "news" category if ( in_category( 'news', $post ) ) { // Show the published date for "news" category posts return false; } else { // Show the updated date for other posts return true; } } add_filter( 'generate_post_date_show_updated_only', 'custom_post_date_display' );
-
erickimani
Hi,
I would like neither the updated date or the published date to showup.
Currently I set it to show modified post as per your instructions a few years back
Thanks
Eric -
Hi there,
are you wanting to remove the date from just the News category posts ? Or is it from everywhere ?
-
erickimani
Hi,
From everywhere
-
OK.
1. remove the function that Ying provided above.
2. go to Customiser > Layout > Blog and on the Archive and Single tabs. Uncheck the Display Dates
3. in Appearance > Elements edit your Content Templates for your blog and archive pages, and delete the date block.
- You must be logged in to reply to this topic.