快速替换WordPress文章或评论中的某些文字内容

前端之家收集整理的这篇文章主要介绍了快速替换WordPress文章或评论中的某些文字内容前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

站长朋友们在进行的过程中,很多时候想替换某些文章或评论中的文字或内容,比如敏感词和过期内容,或者给某些关键字添加链接,例如推广链接等,今天我们就介绍一下实现的方法。

切换到主题目录,打开 functions.php 文件,加入以下代码即可:

Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891cc5a6dd4815232863-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cc5a6dd4815232863-2">2
Crayon-num" data-line="Crayon-5c891cc5a6dd4815232863-3">3
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cc5a6dd4815232863-4">4
Crayon-num" data-line="Crayon-5c891cc5a6dd4815232863-5">5
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cc5a6dd4815232863-6">6
Crayon-num" data-line="Crayon-5c891cc5a6dd4815232863-7">7
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cc5a6dd4815232863-8">8
Crayon-num" data-line="Crayon-5c891cc5a6dd4815232863-9">9
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cc5a6dd4815232863-10">10
Crayon-num" data-line="Crayon-5c891cc5a6dd4815232863-11">11
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cc5a6dd4815232863-12">12
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891cc5a6dd4815232863-1">Crayon-t">functionCrayon-h"> Crayon-e">wp_replace_textCrayon-sy">(Crayon-v">$textCrayon-sy">)Crayon-sy">{
Crayon-line Crayon-striped-line" id="Crayon-5c891cc5a6dd4815232863-2">Crayon-h"> Crayon-v">$replaceCrayon-h"> Crayon-o">=Crayon-h"> Crayon-t">arrayCrayon-sy">(
Crayon-line" id="Crayon-5c891cc5a6dd4815232863-3">Crayon-h"> '替换为这些'
Crayon-line Crayon-striped-line" id="Crayon-5c891cc5a6dd4815232863-4">Crayon-h"> Crayon-s">'WP建站'Crayon-h"> Crayon-o">=Crayon-h"> Crayon-s">'wordpress建站'Crayon-sy">,
Crayon-line" id="Crayon-5c891cc5a6dd4815232863-5">Crayon-h"> Crayon-s">'阿里云'Crayon-h"> Crayon-o">=Crayon-h"> Crayon-s">''

请根据您的实际需求,修改要替换的内容。

如果您要永久替换某些文字或内容,建议您试试

原文链接:https://www.f2er.com/wordpress/238377.html

猜你在找的wordpress相关文章