Title: comments_template();
Last modified: August 19, 2016

---

# comments_template();

 *  [lh34](https://wordpress.org/support/users/lh34/)
 * (@lh34)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/comments_template-2/)
 * Hi,
 * Is there away of getting the comments_template(); function to only show when 
   $page[‘comments’] is used? When I do $page[‘comments’] = comments_template();
   it still shows the comments template, but not in the place I want it to.
 * Any help would be appreciated.
 * Many thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [lh34](https://wordpress.org/support/users/lh34/)
 * (@lh34)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/comments_template-2/#post-1611483)
 * Ideally I would like to use get_comments_template(); but that’s not possible!
 *  [cxbyte](https://wordpress.org/support/users/cxbyte/)
 * (@cxbyte)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/comments_template-2/#post-1611683)
 * try
 * ob_start();
    comments_template(); $page[‘comments’] = ob_get_contents(); ob_end_clean();
 * then
    print_r($page[‘comments’]) in any place. 😉

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘comments_template();’ is closed to new replies.

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)
 * [comments_template](https://wordpress.org/support/topic-tag/comments_template/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [cxbyte](https://wordpress.org/support/users/cxbyte/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/comments_template-2/#post-1611683)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
