Skip Navigation

[Resolved] Display the comment block in a paginated view.

This support ticket is created 8 years, 5 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Beda 8 years, 5 months ago.

Assisted by: Beda.

Author
Posts
#348971

I am trying to: I have a site that displays images that are specific to a customer. The images are within a CPT and I require the customer to be able to comment on them. The CPT is displayed via a view, which is paginated.

I have created a sample comment in the backend, but it will not show on the front end.

I have everything 'comment related' switched on (Allow comments etc) but it just will not show in the view.

I am using TwentyFifteen theme at present and no other plugins (except Toolset ones) are activated.

#349022

Thank you for contacting us here in the Support Forum

The comments use a specific template of the Theme and are called by another function as the_content, and therefore Views can't really style those.

You can, out of the Box, display a amount (number of) comments using the ShortCode [wpv-post-comments-number]
https://toolset.com/documentation/views-shortcodes/#wpv-post-comments-number

Since Content Templates replace only the_content, and if you use a Content Template on single posts, those would still display below the replaced the_content.

On Views, you list more then one Post and here Comments are not to display usually (like on archives), but only if you navigate to a single Post.

What you can do is to create a Custom ShortCode that gets the Posts Comments and returns them, so you can display them also in a View:
https://codex.wordpress.org/Shortcode_API
https://codex.wordpress.org/Function_Reference/get_comments

Please let me know if you need further infos about this.

Thank you for your patience.

#349323

Thanks for your assistance.
I managed to create a shortcode that displays the comment block. I seems to work for the first item in the paginated view, but the subsequent 'pages' just seem to omit the comment block entirely, unless I refresh it - does this have anything to do with AJAX pagination?

#349689

Thanks for the Details

If you quickly enable another (or none at all) pagination, does it work then?

I rather suspect a issue with how you're getting the comments

Pay attention to the ID of the comment / post you are passing.

Perhaps you did hardcode it or it gets only the first Comment in loop?

Please, if you need further help with this, can you first check what the pagination differences are, and if none, provide me a link to a pastebin or the code you use, to construct your shortcode.

I might then be able to spot the issue ad help you achieve this goal.

Please let me know if you have further questions regarding the issue mentioned in this Thread

Thank you for your patience.

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