Paid Addons Support Forum Only

Please note, that here we only support Paid Addons issues and questions.

gVectors Support staff works from 6am to 6pm (GMT+0)

All questions related to wpForo and wpDiscuz free plugins should be asked in the corresponding plugin support forum:

 

wpDiscuz Support Forum   wpForo Support Forum

[Solved] show comments from another page  

  RSS

face2005
(@face2005)
New Member
Joined: 2 years ago
Posts: 2
05/04/2020 3:00 pm  

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


Astghik
(@astghik)
Support Team Admin
Joined: 2 years ago
Posts: 4137
06/04/2020 2:43 pm  

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
(@face2005)
New Member
Joined: 2 years ago
Posts: 2
06/04/2020 3:22 pm  

Hello! Cool! Everything works, thank you!


Share: