Notifications
Clear all

Limited Support

Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed. We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.

 

[Solved] show comments from another page

3 Posts
2 Users
0 Reactions
1,216 Views
(@face2005)
New Member
Joined: 7 years ago
Posts: 2
Topic starter  

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: 6444
 

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: 7 years ago
Posts: 2
Topic starter  

Hello! Cool! Everything works, thank you!


   
Share:
Scroll to top