Skip Navigation

[Resolved] Display an icon when a new post is published.

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to display a badge or notification that there is new content on the site published or modified within the past, say, 48 hours?

Solution:
You would create a View that queries the kinds of content you want to check the publish/modify date for and outputs the badge or message you want to display, e.g. "Fresh content!". You can probably disable the wrapper div for a simple View such as this.

Then you need to add some code that uses the Views API hook wpv_filter_query to modify the query so that only posts modified within the target period are returned. An example of such code is given below: https://toolset.com/forums/topic/display-an-icon-when-a-new-post-is-published/#post-1224497

This support ticket is created 5 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 15 replies, has 2 voices.

Last updated by larryL 5 years, 7 months ago.

Assisted by: Nigel.

Author
Posts
#1229502

My issue is resolved now. Thank you!