Sohag,你在寻找get_comments()
.
请参阅Codex.
<?php $args= array(
\'author_email\' => \'\',
\'ID\' => \'\',
\'karma\' => \'\',
\'number\' => \'\',
\'offset\' => \'\',
\'orderby\' => \'\',
\'order\' => \'DESC\', //ASC or DESC
\'parent\' => \'\',
\'post_id\' => 0,
\'post_author\' => \'\',
\'post_name\' => \'\',
\'post_parent\' => \'\',
\'post_status\' => \'\',
\'post_type\' => \'\',
\'status\' => \'approve\', //approve, hold, spam, trash
\'type\' => \'\',
\'user_id\' => \'\',
\'search\' => \'\',
\'count\' => false,
\'meta_key\' => \'\',
\'meta_value\' => \'\',
\'meta_query\' => \'\',
);
$wpse_comments = get_comments( $args );
foreach( $wpse_comments as $s_comment ) :
echo $s_comment->comment_author;
echo \'<br />\';
echo $s_comment->comment_content;
endforeach;
?>
改变现状
Page Template 并在其中使用代码。希望您能理解代码的含义。不需要从这里复制所有的论点,只需要接受你需要的论点,让另一个安静下来。
尝试<?php var_dump( $wpse_comments ); ?>
查看查询得到的属性是什么,然后相应地使用它们。