Call this function with the following syntax from where you want display the comments on your template... Save the following function in a separate file with a php extension and "include" that file from b2template.functions.php file. %' AND comment_content NOT LIKE '%%' " . " AND comment_content != '' " . " ORDER BY comment_date DESC LIMIT $number"; $joinresult = mysql_query($joinquery) or die(mysql_error()); $querycount++; while ($rows = mysql_fetch_array($joinresult)) { $postID = $rows["ID"]; $commentID = $rows["comment_ID"]; $commentauthor = stripslashes($rows["comment_author"]); $commentauthorurl = $rows["comment_author_url"]; $commentcontent = strip_tags(stripslashes($rows["comment_content"])); if (!empty($excludearray)) { foreach ($excludearray AS $exclude) { $commentcontent = str_replace($exclude, '', $commentcontent); } } if ($show_date == 1) { $commentdatetime = $rows["date"]; } if ($show_time == 1) { if ($show_date == 1) { $commentdatetime .= ' @ '; } else { $commentdatetime = '@ '; } $commentdatetime .= $rows["time"]; } if ($popup == 1) { $link = ' $commentlength) { $link .= $replacestr.''; $commentcontent = substr_replace($commentcontent, $link, $commentlength); } else { $link .= '[Post]'; $commentcontent .= $link; } if (empty($commentauthorurl) || strlen($commentauthorurl) < 12) { echo $commentauthor.$authorstr; } else { echo ''.$commentauthor.''.$authorstr; } echo "
\n"; echo $commentcontent."
\n"; if ($show_date == 1 || $show_time == 1) { echo "on ".$commentdatetime."

\n\n"; } else { echo "
\n"; } } } ?>