[英]How can I add reply to comments in Wordpress
我有以下代碼用於獲取評論和呈現評論表單。 但我看不到對此評論的任何回復。 我已經搜索了網絡,但是仍然無法確定要使用什么功能以及在哪里使用它。
這是呈現表單的代碼:
$comments_args = array(
'fields' => $fields,
'comment_field' => "<div class=\"comment-component\"><textarea name=\"comment\" id=\"comment\" ></textarea></div>",
'comment_notes_after' => '',
'title_reply' => 'Comment on this post!',
'title_reply_to' => 'Reply to this comment',
'label_submit' => 'Comment',
'comment_notes_before' => "<p class='simple-title'>" . 'We will not publish you email' . ' '
);
comment_form($comments_args);
這是呈現所有注釋和關聯數據的函數:
function behdis_comment($comment_storage, $arguments = array('author' => true, 'date' => true,'id' => true,
'content' => true,'thumb' => true, 'class_name_main' => 'post-each-comment', 'class_name_meta' => 'post-each-comment-meta'))
{
/** First we have to check for the argument. **/
// bc = behdisComment
$bc_author = $arguments['author'];
$bc_date = $arguments['author'];
$bc_id = $arguments['author'];
$bc_content = $arguments['author'];
$bc_thumb = $arguments['author'];
$bc_container_class = $arguments['class_name_main'];
$bc_meta_class = $arguments['class_name_meta'];
// cont = container
// main wrapper for each induvidual comment
$cont_main_opening = "<div class=\"$bc_container_class\">";
$div_closing = "</div>";
// end of main wrapper
// main wrapper for each induvidual comment
$cont_main_opening = "<div class=\"$bc_container_class\">";
// end of main wrapper
$cont_meta_opening = "<div class=\"$bc_meta_class\">";
foreach($comment_storage as $comment_each)
{
echo $cont_main_opening;
/** Author **/
if($bc_author===true){echo $cont_meta_opening;}
if($bc_author===true){echo $comment_each->comment_author;}
echo ' ';
if($bc_date===true){echo get_the_time('j F, Y');}
if($bc_date===true){echo $div_closing;}
/** Author **/
echo $comment_each->comment_content;
echo $div_closing;
}
}
看起來'date','id','content'和'thumb'都設置為$ arguments ['author'];
這是錯字嗎?
如果沒有,這可能是您的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.