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

[Solved] Distinguish between comments on pages differing only by query strng parameter

7 Posts
2 Users
0 Reactions
753 Views
Posts: 4
Topic starter
(@timbergski)
New Member
Joined: 3 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.

6 Replies
Asti
Posts: 7618
 Asti
Support
(@asti)
Illustrious Member
Joined: 7 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.

5 Replies
(@timbergski)
Joined: 3 years ago

New Member
Posts: 4

@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: 3 years ago

New Member
Posts: 4

@asti Hello, is there a solution to my problem or would I have to create a post/page per product?

Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7618

@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: 3 years ago

New Member
Posts: 4

@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
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7618

@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.

Share: