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 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.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
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+01:00)
Ce sujet contient 15 réponses, a 2 voix.
Dernière mise à jour par larryL Il y a 5 années et 6 mois.
Assisté par: Nigel.