The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Display Comments fo...
 
Share:
Notifications
Clear all

Question [Solved] Display Comments for Alternate Post ID

5 Posts
2 Users
0 Reactions
938 Views
Posts: 4
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@sjf-i)
Active Member
Joined: 1 year ago
[#9405]

Hi there, i created a custom page template that displays different data based on the parameters in the URL, and im trying to alter the post id that wpdiscuz saves to.

For example, the page is .../Music/Artists/?ArtistID=150&Album=5

The problem im having is that the same comments thread is showing for all artists and albums, because its using the post id for the /Music/Artists/ page - i see this in the admin comments section.

My approach:

I created a custom post with wp_insert_post, titled "Album Discussions - (ArtistName/AlbumName)" with MusicThreads as the type. That generates a Post ID that i can save the comment thread to.

I've added MusicThreads to the default form in wpdiscuz settings.

The question i have is how can i call a wpdiscuz comment section and point it to the new post id instead of the page's post id? 

Thank you so much for your time, expertise and assistance!


4 Replies
Asti
Posts: 8210
 Asti
Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@asti)
Illustrious Member
Joined: 8 years ago

Hi,

Please note that wpDiscuz works with the global post. Before displaying the page, it requires modifying the global post.


Reply
Posts: 4
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@sjf-i)
Active Member
Joined: 1 year ago

Hello, i spent quite a bit of time before posting here trying to modify the global post with the alternate post id, calling comments_template(), and then reverting the global post, but that did not work. I even tried modifying the global wpquery.

Modifying the global post did however work when i disabled commenting on the page, but it displayed the generic wp comment system and not wpdiscuz, so that led me here to see if someone with the inside scoop could help pinpoint a filter or something to override the post with. 

I was also wondering if it was maybe something to do with the caching features? I dont know where to start with that though.

I'm ok with pro support reaching out too if required.

Thanks!


Reply
2 Replies
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8210
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@sjf-i 

We're sorry, but we’re unable to assist you further with this question.


Reply
(@sjf-i)
Joined: 1 year ago

Active Member
Posts: 4
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@asti

I figured it out! I narrowed the issue down to the comments being submitted with the wrong post id. So the solution involved injecting the correct post ID in to the wpd ajax object with js when the page loads. This was required in addition to modifying the global post to render the appropriate comment thread.

document.addEventListener("DOMContentLoaded", function () {
    if (typeof wpdiscuzAjaxObj !== "undefined") {
        wpdiscuzAjaxObj.wc_post_id = ALTERNATE_POST_ID; 
    }
});

Reply
Share: