Use egg_list_entities() instead and you can get that specific blog's guid right from the url
blog/view/guid_here/
And you get something like this, I put the comments in the sidebar just for this example
Your code will fetch all the comments on the $gui_post entity. You have to iterate on those comments to output the data like,
$comments = elgg_get_entities(array(
'type' => 'object',
'subtype' => 'comment',
'container_guid' => $gui_post,
));
if($comments){
foreach($comments as $comment){
echo $comment->description;
}
}
Or, like cim mentioned, you can use the elgg's listing view if you use elgg_list_entities() instead
echo elgg_list_entities(array(
'type' => 'object',
'subtype' => 'comment',
'container_guid' => $gui_post,
));
Hi, I tested the code but not work, return null, the var $gui_post equals '126' that is the guid of the article, I 'm doing something wrong ?.
$comments = elgg_list_entities(array(
'type' => 'object',
'subtype' => 'comment',
'container_guid' => '126',
));echo $comments;
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.