# How to put Discourse comments somewhere other than the default comment location?

**URL:** <https://meta.discourse.org/t/how-to-put-discourse-comments-somewhere-other-than-the-default-comment-location/152826>\
**Category:** WordPress\
**Created:** [26 mei 2020 om 20:41 UTC](https://meta.discourse.org/t/how-to-put-discourse-comments-somewhere-other-than-the-default-comment-location/152826 "2020-05-26T20:41:48Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [30 mei 2020 om 00:03 UTC](https://meta.discourse.org/t/how-to-put-discourse-comments-somewhere-other-than-the-default-comment-location/152826/8 "2020-05-30T00:03:05Z")

</div>

I’ve added a static helper function to the plugin that can be used to display comments without loading the Discourse comments template. The function is here: [`get_discourse_comments`](https://github.com/discourse/wp-discourse/blob/master/lib/utilities.php#L528). It requires you to supply the `post_id` of the WordPress post that you want to display the comments for. Here’s a simple example of its use:

```php
<?php
use WPDiscourse\Utilities\Utilities as DiscourseUtilities;
$discourse_comments = DiscourseUtilities::get_discourse_comments( 859 );
echo $discourse_comments;

```

It displays the comments in the same way as they are displayed if you select the  
Enable Discourse Comments/Display Comments option (found on the plugin’s Comment Settings tab.) When this function is used, the value of that setting is ignored, but all other settings on that page are respected.

---

_[View the full topic](https://meta.discourse.org/t/how-to-put-discourse-comments-somewhere-other-than-the-default-comment-location/152826)._
