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

WP SITES

2551

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Register
  • Videos
  • 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

Primary Sidebar

How it works :

I write tutorials for you which include the custom code you need for a flat $49.99 fee. You get 1 tutorial request as well as access to all 2500+ existing tutorials for 1 month.

  • Premium Members Only
  • Access Premium Tutorials
  • Support