Community Forums › Forums › Archived Forums › Design Tips and Tricks › Remove the Date from Blog Posts?
Tagged: removing post dates
- This topic has 8 replies, 2 voices, and was last updated 10 years, 11 months ago by sanjeev.
-
AuthorPosts
-
May 6, 2013 at 8:05 pm #39643Scott MilfordMember
Hi all!
I'd like to not have the date show on my blog posts because the content is meant to be evergreen and a date might make it seem like old information. I don't see an option in the admin panel anywhere for the Fabric theme, so I guess I'm going to have to dig into a php file.
Does anyone know how I can prevent the dates from showing up with my blog posts?
Thanks,
Scott
http://behaviorandmotivation.comMay 6, 2013 at 9:53 pm #39652sanjeevParticipantIf you are talking about the date shown in byline, then you can customize it through a function...Example code snippet can be found at http://my.studiopress.com/snippets/post-info/#customize
Let me know what you want to show and I can give you the code to copy it child function.php file.....
May 7, 2013 at 1:47 pm #39761Scott MilfordMemberSanjeev,
Thanks for your reply. You are correct. It's the date near the by-line. Basically, I don't want the date to show at all. Is that doable?
Scott
May 8, 2013 at 9:04 pm #40019sanjeevParticipantok, in that case you can use the code mentioned in the link I mentioned:
http://my.studiopress.com/snippets/post-info/#customize
Just remove the '[post_date] by' from the $post_info and it should stop displaying date....
May 8, 2013 at 9:09 pm #40020sanjeevParticipanthere is the customized code which will only display Author in the by line...
add_filter( 'genesis_post_info', 'post_info_filter' ); function post_info_filter($post_info) { if ( !is_page() ) { $post_info = 'By [post_author_posts_link]'; return $post_info; }}
If you want to add anything more you can add it after [post_author_posts_link].
May 9, 2013 at 8:55 pm #40221Scott MilfordMemberSanjeev,
That worked. Thanks. However, it also removed some information that I'd like to keep. Here's a before and after:
Was:
May 7, 2013 by Scott Milford · 6 Comments (Edit)Now:
"By Scott Milford"How can I make it look like this?
"by Scott Milford · 6 Comments (Edit)"
Thanks for your help, Sanjeev. You're awesome!
May 9, 2013 at 9:13 pm #40223Scott MilfordMemberI was able to get it to display properly, but the weird thing is that it's only displaying properly on the archive pages. On the Home page, it only displays my name.
Here's what my code looks like right now:
/** Customize the post info function */
add_filter( 'genesis_post_info', 'fabric_post_info_filter' );
function fabric_post_info_filter($post_info) {
return 'by [post_author_posts_link] · [post_comments] [post_edit]';
}Sorry about the code. I don't know how to use Pastebin (or anything else) so that it is formatted the right way.
May 9, 2013 at 9:24 pm #40228Scott MilfordMemberHmmm.... I don't get it. I checked it again and it seems to be displaying correctly on the Home page and all other pages, too. It's showing the "By" line and the comment link as well, just as I wanted it.
So I guess everything is good now. Thanks so much for your help, Sanjeev. I sincerely appreciate it!!
Cheers!
May 9, 2013 at 9:30 pm #40229sanjeevParticipantIt might be your cache plugin, which takes some time to show changes for the cached pages...
Your code looks fine, so it is ok....Glad I was able to help...
-
AuthorPosts
- The topic ‘Remove the Date from Blog Posts?’ is closed to new replies.