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...
 
Notifications
Clear all

Question [Solved] Display Comments for Alternate Post ID

5 Posts
2 Users
0 Reactions
1,057 Views
(@sjf-i)
Posts: 4
Active Member
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
 
[#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!


 
Posted : 20/12/2024 10:07 am
Asti
 Asti
(@asti)
Posts: 8271
Illustrious Member 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
 

Hi,

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


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 21/12/2024 12:33 pm
(@sjf-i)
Posts: 4
Active Member
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
 

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!


 
Posted : 22/12/2024 11:45 pm
Asti
 Asti
(@asti)
Posts: 8271
Illustrious Member 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
 

@sjf-i 

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


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 25/12/2024 1:25 pm
(@sjf-i)
Posts: 4
Active Member
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
 

@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; 
    }
});

 
Posted : 30/12/2024 9:28 am