wordpress回复评论邮件中没有连接
时间 : 2023-12-05 23:17:02声明: : 文章内容来自网络,不保证准确性,请自行甄别信息有效性

最佳答案

很抱歉听到你遇到WordPress回复评论邮件中没有连接的问题。这个问题可能由于一些原因导致,但是有几种常见的解决方法。

首先,请确保你的WordPress主题和插件都是最新版本。有时候旧版本的主题或插件可能会导致一些功能不正常。你可以登录到你的WordPress后台,检查主题和插件是否有更新可用。

其次,你可以检查一下你的回复评论邮件模板设置。在WordPress的设置中,你可以找到邮件模板设置。请确保你的邮件模板中没有遗漏连接的部分。你可以编辑邮件模板,添加或修复任何缺失的连接。

另外,你还可以尝试通过安装一些第三方插件来解决这个问题。例如,你可以安装并启用WP Better Emails插件。这个插件可以改善WordPress评论邮件的样式和功能,包括添加连接。

最后,如果以上方法都没有解决问题,你可以考虑联系你的WordPress主题或插件的开发者,向他们报告这个问题。他们可能能够提供更具体的解决方案或修复问题的更新版本。

希望以上的方法能够帮助你解决WordPress回复评论邮件中没有连接的问题。如果你还有其他问题,我会很乐意帮助你。

其他答案

在WordPress中,默认情况下,当有新评论发布时,WordPress会通过邮件通知网站管理员。然而,这些评论通知邮件中的回复评论并没有包含连接。如果你想在回复的评论邮件中添加连接,你可以通过自定义邮件模板的方式实现。

首先,你需要在你的WordPress主题中创建一个自定义邮件模板。你可以通过以下步骤来完成:

1. 在你的主题文件夹中创建一个名为`/your-child-theme-folder/comments.php`的文件。如果你的主题是基于父子主题的结构,那么你应该使用子主题的文件夹。

2. 打开该文件,然后将以下代码添加到文件的顶部:

```php

<?php

/**

* Custom comment email template

*/

// Get the comment author's name

$comment_author = get_comment_author();

// Get the comment content

$comment_content = get_comment_text();

// Get the URL of the current post

$post_url = get_permalink();

// Get the URL of the comment

$comment_url = get_comment_link();

// Get the comment parent ID

$parent_id = get_comment_parent();

// If the comment has a parent, get the parent comment

if ($parent_id != 0) {

$parent_comment = get_comment($parent_id);

}

?>

3. 在邮件内容中的合适位置,你可以使用以下代码来显示回复评论的连接:

```php

<?php if ($parent_id != 0) : ?>

<p>In response to your comment on <a href="<?php echo $post_url; ?>"><?php echo get_the_title(); ?></a>:

<p><?php echo $parent_comment->comment_content; ?>

<p>You can view the entire conversation and reply by following this link: <a href="<?php echo $comment_url; ?>"><?php echo $comment_url; ?></a>

<?php endif; ?>

以上代码中,我们首先检查评论是否有父级评论。如果评论有父级评论,我们将在回复评论的邮件中包含原始评论的内容,并提供一个连接,使读者可以查看整个对话并回复。然后,我们使用`get_the_title()`获取当前文章的标题,`get_the_permalink()`获取当前文章的链接,`$comment_url`获取回复评论的链接。

保存并上传你的自定义`comments.php`文件到你的WordPress主题文件夹中。

现在,当你向评论进行回复时,回复评论邮件中将包含连接。这样,读者就可以直接点击连接跳转到相关评论所在的页面,从而更方便地参与讨论。