Skip Navigation

[Resolved] Show the total amount of two post views

This support ticket is created 2 years, 1 month 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 2 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#2319343
view-amount-of-jobs.jpg
calculate-posts.jpg

Tell us what you are trying to do?
I list the number of related posts available in two different views (that part works fine).
Now I would like to have a "Total amount", showing the amount of these two view posts together.
I think the attached image will explain better what I'm looking for.

Is there any documentation that you are following?
Can't find anything relevant in the forum.

Is there a similar example that we can see?
See images.

#2320221

Hello,

There isn't such kind of built-in feature with Toolset plugins, you might consider custom JS codes, for example:
1) Get the post count value from those two HTML elements
2) Calculate the result, then update the specific HTML element value as what you want.

More help:
hidden link

#2320357
view-in-view.jpg

Hi Luo,
That was actually my first thought as well, so I have started to look into this but...

In order to solve this, I need to be able to add [wpv-found-count] twice in the same table row/cell. And this is because each row is listing a post type that has related post types connected to it. In my case I have a post type called DAY (listed in one row) and two post types connected as INCOMING and OUTGOING (listed as a value in a cell in each row).
So my question is if it is possible to create a view, put it in my main view loop (the table output), and within that view also have 2 other views? One view for getting [wpv-found-count] for INCOMING and another for OUTGOING.

If that is possible, then I can perhaps add a JS-script that can calculate the two printed values (found count).
See image for what I'm looking for.
Also, is it possible to create this view on a different page (just to make it easier to work with, rather than fiddle around within table and cell) and then use a shortcode for it within the table cell?

The reason I want to add two views within a containing view, is to be able to add the JS-code that affects only these two views in this cell.

Or do you have any other suggestions on how I can get the values for wpw-found-count, for these two related post types and put them in a single cell?

Thanks!

#2320369

Q1) So my question is if it is possible to create a view, put it in my main view loop (the table output), and within that view also have 2 other views? One view for getting [wpv-found-count] for INCOMING and another for OUTGOING.
No, as I mentioned above, there isn't such kind of built-in feature, [wpv-found-count] shortcode works only for one current post view.
See our document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-found-count

Q2) Or do you have any other suggestions on how I can get the values for wpw-found-count, for these two related post types and put them in a single cell?
As I suggest above:
https://toolset.com/forums/topic/show-the-total-amount-of-two-post-views/#post-2320221
Please try with custom JS codes to get the calculated value.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.