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

[Solved] show comments from another page

3 Posts
2 Users
0 Reactions
1,792 Views
(@face2005)
New Member
Joined: 8 years ago
Posts: 2
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
  [#5613]

Hello! there is a "reviews" page, there are wpDiscuz comments .. how to duplicate these wpDiscuz comments on the main page for example ...



   
Astghik
(@astgh)
Illustrious Member Admin
Joined: 8 years ago
Posts: 6645
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 @face2005,

wpDiscuz doesn't have such a feature, However, I've contacted plugin developers they provide a solution for you. Please follow the steps below:

1. Put the codes in the functions.php file of the active theme:

 

add_filter("wpdiscuz_js_options", function ($optionsJs){
   if (is_front_page()) {
       $optionsJs["wc_post_id"] = X;
   }
return $optionsJs;
});
add_filter("is_load_wpdiscuz", function ($load){
   if (is_front_page()) {
    $load = true;
   }
return $load;
}) 

 

2. This code should be added in the page content where you'd like to add duplicated comments: 

if (is_front_page()) {
$oldId = get_the_ID();
$post = get_post(X);
comments_template();
$post = get_post($oldId);
} else {
comments_template();
} 

Please change the value of the red marked code. You should use the page_Id whose comments should be loaded on the current page instead of the X

We cannot guarantee that this will work in 100% as far as this is just a quick solution and Product Modifications and Customization is not included in our Support. 

 



   
(@face2005)
New Member
Joined: 8 years ago
Posts: 2
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! Cool! Everything works, thank you!



   
Share:
Scroll to top