Looking to get rid of dates from appearing in the post info text in your Genesis site?
Add the following in child theme’s functions.php
:
add_filter( 'genesis_post_info', 'sp_post_info_filter' );
/**
* Customize entry meta in the entry header.
*
* @param string $post_info Existing post info
* @return Modified post info
*/
function sp_post_info_filter( $post_info ) {
$post_info = __( 'by', 'genesis' ) . ' [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
}
Before:
After:
Reference: genesis/lib/structure/post.php
Hi Sridhar,
This one didn’t work for me. I went into the theme folder via FTP and modified functions.php in the child theme folder with the code you supplied but it had no effect that I can see. I flushed out the cache but I’m still seeing the dates. Any idea why?
Thanks,
Bill
The child theme in use on your site, Daily Dish Pro has similar code already present in its functions.php. Instead of adding the code in this tutorial you need to locate
https://pastebin.com/raw/C3Y2HSF2
in functions.php and change it to:
https://pastebin.com/raw/hiteLPBG
Hi Sridhar,
I really appreciate your help but, unfortunately, that change didn’t work.
Can you paste the full code in your functions.php at pastebin.com and share the link?
Is Genesis Simple Edits plugin active by any chance?
Hey Sridhar, in past I got some useful trick from this site.
But, this time I want to hide publish date from my post. But, it didn’t work.
So, please help with regard to this.
Which theme are you using? Can you provide the URL of your site?
Hi Sridhar !
The code works perfectly on Ambiance, thank you.
I was wondering if you knew a way to make the date appear on the post itself, but not on the landing page, so we could only see the title and the featured image when on the homepage.
Cheers,
Genevieve
This just worked perfectly for me! Thank you so much, you saved me hours!
Worth keeping in mind, if you are using the plugin “Genesis Simple Edits” it has its own setting for this, which might be overriding this code (I tried this code in Beautiful Pro theme and it didn’t work, then I realised I could make the change in the Simple Edits interface.)
Hi Sridhar!
The code worked for me on Essence. But what I was trying to accomplish was to leave the category only and remove date, author, and comments. How should I get this result?
Are you asking about single posts? If so, follow https://sridharkatakam.com/how-to-customize-entry-meta-in-essence-pros-entry-header/.