Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Woo, that’s a tough one. It doesn’t exist yet, but I imagine something like..

    [if field="date" value="today -10 days" compare="more"]
      New!
    [/if]

    ..so that this would be true if the publish date is within the past 10 days. Older than that, it would be false.

    It looks like a useful feature, so I’ll try to implement it for the next update.

    Thread Starter Jerrad

    (@jjgleim)

    Awesome! Can’t wait for the update.

    Thanks so much!

    Jerrad

    Plugin Author Eliot Akira

    (@miyarakira)

    OK, please see the latest plugin update. You can compare published date with parameter before or after.

    [if after="10 days ago"]
      New!
    [/if]

    This should display for posts that were published within the last 10 days. The value can be a specific date like 2015-03-01, or relative: 2 weeks ago, etc.

    In addition, I added the same parameters to the loop. To get posts within the last 2 weeks:

    [loop type="post" after="2 weeks ago"]
      ...
    [/loop]

    Thanks for the suggestion, it wasn’t too hard to implement and this feature will come in handy for me as well. Please let me know if it works for you.

    Thread Starter Jerrad

    (@jjgleim)

    It works great!

    Thanks so much for adding this feature.

    Take care,

    Jerrad

    if there any way to use this function with a date stored in a custom field?

    Plugin Author Eliot Akira

    (@miyarakira)

    Hi laikmosh,

    Yes, it’s possible to use before and after parameters with custom fields, in place of value and compare. If you need more details, please start another support post and I can help you there.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display added text to loop using IF and compare to published date’ is closed to new replies.