Answer the question
In order to leave comments, you need to log in
How to display comments from VK discussions on a WordPress site?
People, hello everyone, you need to remove comments from the discussion topic (there are a lot of reviews in the VK group) VK to the site. I found several ways on the Internet: they all come down to the VK API ( https://vk.com/dev/board.getComments), because There is no specialized widget for such purposes. Created the following query:
<?php
$request_params = [
'group_id' => '92457343',
'topic_id' => '32000957',
'need_likes' => 1,
'offset' => 0,
'count' => 100,
'extended' => 1,
'sort' => 'desc',
'version' => 5.87,
'access_token' => '***'
];
$url = "https://api.vk.com/method/board.getComments?" . http_build_query($request_params);
$result = file_get_contents($url);
echo $result;
?>
Answer the question
In order to leave comments, you need to log in
As an option:
1. Create a php template for the page
2. Parse the JSON array in this template using curl
3. Display everything in the right form.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question