Show Image only if post is not older than x amount of days

Hey hey, I had an idea to show a “new” image on my archive page on posts that are not older than a certain amount of days.

I’ve found “publish date” but I’m not quite sure if I can create a condition that looks at the current date and adds a number of days.

Would something like this work?

Hi @PhilTone,

Thanks for reaching out.
You can add a condition based on the publish date, and compare it with any other date as shown in the given screenshot. But there is no such option to calculate the number of days.

If you still want to do that, I would suggest you hire a developer who can assist you with the customization or you can avail of our newly launched service called One TOTAL CARE, where we offer small customizations

Thanks

Hmm the problem is that it would have to be dynamic since it doesn’t make sense to always check that date and change that. I will check if I find some other solution if it’s not possible with conditions.

Hi @PhilTone,

What I suggest here, is that you can create a custom Dynamic Content and compare it with the value returned by that. So the custom Dynamic Content tag will call a method that returns the number of days, that can be compared in the Condition for the image.
I would suggest you go through the following thread describing how you can create a custom Dynamic Content tag.

Hope it helps.
Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.