gpt4 book ai didi

php - 如何更改 "post comment"按钮上的文本?

转载 作者:太空宇宙 更新时间:2023-11-04 14:05:23 24 4
gpt4 key购买 nike

我正在使用 wordpress 为一些治疗师建立一个网站,并使用帖子的评论部分与治疗师进行问答。但是我无法在“发表评论”按钮上找到文本的来源。我想将其更改为“发布问题”。

主题中的 comments.php 没有任何内容,我在主 wp-comments-post.php 中的任何地方都找不到它

任何帮助都会很棒!

谢谢

网址是http://s416809079.onlinehome.us/ask-the-therapist/

编辑:我的困惑是我在任何地方都找不到“发表评论”。另外,如果我只是添加它,那么就会变成两个按钮,而新按钮实际上不会提交。这是代码。

<?php
/**
* Comments Template
*
* @file comments.php
* @package Pilot Fish
* @filesource wp-content/themes/pilot-fish/comments.php
* @since Pilot Fish 0.1
*/
if ( post_password_required() ) : ?>
<p class="nocomments"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'pilotfish' ); ?></p>
<?php /* Stop the rest of comments.php from being processed */
return;
endif; ?>

<?php if (have_comments()) : ?>
<h6 id="comments"><?php comments_number(__('No Response to', 'pilotfish'), __('One Response to', 'pilotfish'), __('% Responses to', 'pilotfish')); ?> <i><?php the_title(); ?></i></h6>

<ol class="commentlist">
<?php wp_list_comments('avatar_size=60'); ?>
</ol>

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
<nav class="pager">
<div class="previous"><?php previous_comments_link(__( '&#8249; previous','pilotfish' )); ?></div><!-- end of .previous -->
<div class="next"><?php next_comments_link(__( 'next &#8250;','pilotfish', 0 )); ?></div><!-- end of .next -->
</nav><!-- end of.pager -->
<?php endif; ?>

<?php else : ?>
<?php if (comments_open()) : ?>

<?php
$fields = array(
'author' => '<p id="comment-form-author">' . '<label for="author">' . __('Name','pilotfish') . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) .
'<input id="author" name="author" placeholder="'. __('name (required)', 'pilotfish').'" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30" /></p>',
'email' => '<p id="comment-form-email"><label for="email">' . __('E-mail','pilotfish') . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) .
'<input id="email" name="email" placeholder="'. __('email (required)', 'pilotfish').'" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30" /></p>',
'url' => '<p id="comment-form-url"><label for="url">' . __('Website','pilotfish') . '</label>' .
'<input id="url" name="url" placeholder="'. __('website', 'pilotfish').'" type="text" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></p>',
);
$defaults = array('fields' => apply_filters('comment_form_default_fields', $fields));
comment_form($defaults);


?>
<?php endif; ?>

最佳答案

Comment Form Codex包含您需要了解的有关自定义评论表单值的所有信息。

$defaults = array(
'fields' => apply_filters('comment_form_default_fields', $fields),
'label_submit' => __('Post a Question')
);
comment_form($defaults);

这应该可以满足您的需求。

关于php - 如何更改 "post comment"按钮上的文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12828181/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com