• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Replace Comment Date With Text When Comments Older Than Specific Date

This PHP code enables you to display text in replace of the comment date if the comment is older than a specific date. In this example, all comments older than 1 year will display the text “Older Than 1 Year”. All comments less than 1 year old will display the comment date.

Video Demonstration

Here’s a video demo:

There’s 2 code snippets included in this tutorial.

1. The 1st code snippet removes the time and only displays the comment date or the custom text.

date

When comment is older than 1 year:

text

2. The 2nd code snippet doesn’t remove the time so it displays the comment date for comments less than a year old and the text “Older Than 1 Year” inline with the time like you see in the following image:

text

Here’s the code snippets for logged in members:

Register for full access

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.