Forums
Forums / Plugins / Hacks / comments_template();
(@lh34)
15 years, 9 months ago
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!
Ideally I would like to use get_comments_template(); but that’s not possible!
(@cxbyte)
try
ob_start(); comments_template(); $page[‘comments’] = ob_get_contents(); ob_end_clean();
then print_r($page[‘comments’]) in any place. 😉
The topic ‘comments_template();’ is closed to new replies.
(@lh34)
15 years, 9 months ago
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!