The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
[Solved] Distinguish between comments on pages differing only by query strng parameter
How-to and Troubleshooting
(@timbergski)
Active Member
Joined: 4 years ago
Hello,
I'm building a site which has a "/product" page. I distinguish between the pages for different products via a query string parameter e.g. /product?id=<the product id>.
I need there to be separate comments for each product. However, any comments get shared between all the different products by default - as comments on the /product page.
Is there a way to fix this, without creating a separate WP page for each product?
Many thanks.
(@asti)
Illustrious Member
Joined: 8 years ago
Hi,
wpDiscuz works fine with default permalinks:
wpdiscuz.com/?p=1
Also, wpDiscuz works if the global $post exists. Please check and make sure everything is correct with the global $post.
(@timbergski)
Joined: 4 years ago
Active Member
Posts: 4
Mar 04, 2022 2:34 pm
@asti Thanks but it's a page and the product-id parameter is interpreted by custom code in the special template for that page. WP knows nothing of this. I can't create (many) posts or pages as the solution to my problem.
(@timbergski)
Joined: 4 years ago
Active Member
Posts: 4
Mar 08, 2022 8:57 am
@asti Hello, is there a solution to my problem or would I have to create a post/page per product?
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8196
Mar 09, 2022 10:07 am
@timbergski,
We're really sorry, but we can't help you with this issue. wpDiscuz is highly dependent on the global $post object.
As far as we understand you're trying to load several products on one page.
(@timbergski)
Joined: 4 years ago
Active Member
Posts: 4
Mar 09, 2022 4:49 pm
@asti Thanks. Is there any way of temporarily overriding $post - in particular, appending the product-related query parameter to the guid - to trick your software into creating separate comment streams for separate products?
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8196
Mar 11, 2022 8:00 am
@timbergski,
In the wpDiscuz js files, depending on the post, it sends the information about the current post via the localize. In your case, if the posts are not loaded with a refresh it won't work.
If the posts load with a refresh it may work.