【发布时间】:2015-07-20 22:27:50
【问题描述】:
我目前在我的 WordPress 博客中使用 Ckeditor 作为 cmets 的编辑器。 我下载了 ckeditor.zip 文件,并在解压 zip 文件后将所有文件上传到站点的根目录。然后我通过引用http://docs.ckeditor.com/#!/guide/dev_installation将它与cmets系统挂钩。除了一些问题外,它运行良好。其中之一是图像未显示。
例如,如果我通过单击“添加图像”按钮插入图像:
图片在评论输入框中显示:
但是,当点击“发表评论”时,图像(通过图像 URL 插入)不会出现在实际的 cmets 中。
我注意到图片在html中以如下形式添加到评论输入框中:
<p><img src="http://www.url.com/...../image_name.jpg" /></p>
供您参考,
1) 我将 comment_form() 部分更改为以下内容:
<?php comment_form(array('comment_field' => '<p class="comment-form-comment">' .
'<textarea id="comment" class="ckeditor" name="comment" cols="45" rows="8" aria-required="true"></textarea>' .
'</p>',
'comment_notes_after' => '')); ?>
2) 我在 cmets.php 文件中添加了以下脚本:
<script type="text/javascript" src="http://www.url-path.com/ckeditor/ckeditor.js"></script>
<script>
CKEDITOR.replace( 'comment' );
</script>
有办法解决这个问题吗?
感谢您的帮助。
注意: 我发现了一个类似的问题 (CKEditor images not working) 但我不知道如何解决这个问题...
【问题讨论】: