Skip Navigation

[Resolved] Cannot figure out how to get the post count to show only once in a view

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

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

This topic contains 4 replies, has 2 voices.

Last updated by Elsie 2 years, 6 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2409551

Tell us what you are trying to do? Get just the number of posts to show in a view. When I put [wpv-found-count] in the view, it loops it the number of times there are posts. I just want the total post count to appear once.

Is there any documentation that you are following? I've looked at a bunch of support tickets, but they did not help

Is there a similar example that we can see?

What is the link to your site? hidden link

#2410321

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Would you please use the shortcode outside the loop and after the loop?

That should fix the duplication issue.

To add additional context:

[wpv-found-count] Displays the total number of posts, users, or taxonomies that have been found by the Views query. This value is calculated before pagination, so even if you are using pagination, it will return the total number of posts matching the query:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-155378

Compare with [wpv-items-count] which will output the number of records on the page:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-items-count

Thanks.

#2410457
where-to-add-things-outside-the-loop.jpg

I do not understand how to put it outside the loop in the new block view editor. I used to know how to do that in the old Views plugin.

#2410747

Christopher Amirian
Supporter

Languages: English (English )

Screen Shot 2022-07-04 at 11.09.30.png

Hi there,

Please click the top-left hamburger menu to see the hierarchy of the blocks in the block editor.

There you will see that the Views block, consists of Views Output, Loop, and some extra stuff.

Find the shortcode block that you used to add the number, and drag it to a place outside the loop section but inside the view itself. Make sure that the shortcode is "after" the loop and not before the loop. (Please check the screenshot)

Thanks.

#2412773

My issue is resolved now. Thank you! That was not intuitive at all, though. But I'm glad you helped me figure it out.