WordPress.org

Forums

comments_template(); (3 posts)

  1. lh34
    Member
    Posted 4 years 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!

  2. lh34
    Member
    Posted 4 years ago #

    Ideally I would like to use get_comments_template(); but that's not possible!

  3. cxbyte
    Member
    Posted 4 years ago #

    try

    ob_start();
    comments_template();
    $page['comments'] = ob_get_contents();
    ob_end_clean();

    then
    print_r($page['comments'])
    in any place.
    ;-)

Topic Closed

This topic has been closed to new replies.

About this Topic