Comments name

From Photostand Wiki

Jump to: navigation, search
comments_name()

The comments_name function will return the current comment author's name. This function must be placed within the the Comments_array loop.

Parameters

This function has no parameters.

Examples

Displaying the comments name

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>

	<title>Article</title>

    </head>
    <body>

        <ul>
	    <?php
    	    foreach(comments_array('DESC') as $comment)
    	    { 
    	    ?>
     	    <li><?php echo comments_name(); ?></li>
	    <?php
    	    }
	    ?>
	</ul>

    </body>
</html>

Basicly, this example will display the author's name for each comment.

Personal tools