我想在主页上的wordpress帖子的标题中进行查找和替换。
Ex。标题:免费歌曲名称下载所需输出:歌曲名称
我如何做一个查找和替换删除"下载"answers"免费"
<h2><?php the_title(); ?></h2>
<?php
if (is_front_page()) {
$title = str_ireplace(array("Download","Free"),array(""),get_the_title());
echo "<h2>".$title."</h2>";
} else {
?>
<h2><?php the_title(); ?></h2>
<?php
}
?>