Skip Navigation

[Resolved] How to show number of comments ( just the number ) in this view

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

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: Africa/Casablanca (GMT+01:00)

This topic contains 1 reply, has 2 voices.

Last updated by Jamal 2 years, 11 months ago.

Assisted by: Jamal.

Author
Posts
#2056321

I am using the following code in the parametric search view however the "number of comments" is showing "3 COMMENTS" or "NO COMMENTS" and we just want to do the following:

If there ARE comments, let's say 3 of them, display "COMMENT (3)" where the :comment is the collapse link and the "(3)" showing total comments is linked to the POST URL ...

Basically, just a way to customize the shortcode for returning comments in views.

Thanks heaps.
Woody House

<div class="wall-of-tips-bottom-links-container">
<div class="wall-of-tips-comment">[expand title="COMMENT  [wpv-post-comments-number]"][comments-template][/expand]</div><div class="wall-of-tips-social-share">[Sassy_Social_Share]</div><div class="wall-of-tips-ratings">[ratings]</div>
</div>

#2056791

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

You can use the different argument from the  shortcode. The % symbol is the actual number of comments. Something like:

[wpv-post-comments-number none='(0)' one='(1)' more='(%)']

Check the available shortcodes here https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-153457

Inside the collapse shortcode, it would be:

[expand title="COMMENT  [wpv-post-comments-number none='(0)' one='(1)' more='(%)']"]

I hope this helps. Let me know if you have any questions.

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