Streak counter

By: Theo Lee | Asked: 10/09/2022
ForumsCategory: How-toStreak counter
Theo Lee asked 2 years ago
Is it possible to display the "streak" of a user?  I have a form which saves the submitted user and I'd like to display a counter of how many submissions in a row of days they have made. For example "you've published 11 days in a row" and then if they miss a day, it would start again.
1 Answers
Victor Font answered 2 years ago
You can do this by writing your own shortcode. The "days in a row" part can be tricky since you'll have to figure out how to count consecutive days as defined by your requirement. Does consecutive days include weekends and holidays or are they skipped and the focus is business days? It's tricky. Anyway, here's an article that describes how to create a shortcode to count entries. There's no date math in this shortcode, you'll have to figure that part out yourself. https://formidable-masterminds.com/count-entries-shortcode/

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right