The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Multi comment secti...
 
Share:
Notifications
Clear all

Multi comment section support on single page?

2 Posts
2 Users
0 Reactions
13 Views
Posts: 1
Topic starter
(@animesubways)
New Member
Joined: 12 hours ago

Is it possible to display multiple comment rating sections on a single page?

I have several distinct sections on my page, and I’d like to add a separate comment section with customizable rating options for each one. This could significantly boost user engagement across the entire page.

I’ve noticed some discussions around this feature here, but it seems like it hasn’t been fully addressed yet.

There’s a clear demand for this functionality, and I believe it could be a valuable add-on for wpDiscuz.

1 Reply
Posts: 4
(@sjf-i)
Active Member
Joined: 1 month ago

Yes, its a little tricky but basically the same thing i accomplished recently; displaying a different comment section on a single custom page based on parameters in the URL.

https://wpdiscuz.com/community/troubleshooting/display-comments-for-alternate-post-id/

In your case you would just build the functionality into the loop that renders each section.

You'll need to create a custom post type if you dont already have one for your sections, then use get_option to fetch the post id for the section, and if one doesnt exist then you create one with wp_insert_post and update_option (to store the post id you created).

Then once you have that custom post id, use the script i shared on my thread linked above to inject the post id into the wpdiscusAjax object, then temporarily override the global post with wp_query (with your custom post type and the custom post id), call comments_template() to render the comment section, and then reset the global post with wp_reset_postdata(). 

Your implementation will be trickier than mine because youre rendering multiple threads on one page, so your javascript will need to track which comment thread is being focused on and switch the post id on the fly before they submit a comment or rating.

I'm also uncertain about how the live ajax updates would work, if it would at all so you might need to disable that feature. 

And note that this appears to be an unsupported, outside-of-the-box method at the moment, so test it thoroughly and with caution. Make lots of backups 🙂 

Reply
Share: