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.
Tell us what you are trying to do?
I want to show the number of new messages on an account page.
Is there any documentation that you are following?
Not that i know of.
Is there a similar example that we can see?
What is the link to your site?
Hope somebody can help me soon 😉
Hi, I was digging through the message module and it doesn't appear to track which messages have been read and which messages have not been read, per User. Without tracking that information, I can't help you display the number of "new" messages. I can help you display the number of messages in the inbox, but that number will include both read and unread messages. Let me know if you would like assistance with that.
To track read messages and determine the number of new items, you would have to add a considerable amount of custom code using PHP. You would also need a custom field that holds a read vs. unread status indicator, per User. It's quite complex and probably falls outside the scope of support we provide here here in the forums.
Thanks for your reply. I know how to display a number to show all the messages. But for what i need that defeats the purpose.
I really thought it was possible with Toolset. 🙁
I would say it is a function that needs to be in there. That would complete the message system. Is it something you guys consider putting in? I think it would be a great feature to have! 😉
I encourage you to submit your request over here: https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
That will be reviewed by key stakeholders who make decisions about upcoming features in the software.
Hi, Yes oke i will do that! 😉
Can you still help me out with showing the number of all messages to a specific user?
Sure, go to Toolset > Views and duplicate the "Messages Received" View. Call it "Number of messages received" or something similar. Edit the new View and in the Pagination and Sliders settings choose "No pagination". In the Custom Search settings panel choose "Full page refresh when visitors click on the search button". Scroll down to the Loop Editor and delete everything from the CSS panel. Replace the loop contents with this:
[wpv-layout-start] [wpv-items-found] [wpv-found-count] <!-- wpv-loop-start --> <wpv-loop></wpv-loop> <!-- wpv-loop-end --> [/wpv-items-found] [wpv-no-posts-found][/wpv-no-posts-found] [wpv-layout-end]
You can add extra markup or CSS around the wpv-found-count shortcode to display some formatting, and you can add text in the wpv-no-posts-found shortcode if you want to display something when no messages are found.
Then place this new View somewhere on your site using the same shortcode attribute described in the Messages setup guide:
[wpv-view name="Number of messages received" info="[wpv-current-user info='id']"]