考虑到一些内联和指定关键字名称的跳转,我们以前可能忘记手工加上,现在如果每个都加上的话确实有些工作量。我们可以通过关键字替换工具wpreplace进行批量添加。或者是我们可以用下面的脚本指定关键字自动加URL。
//自动给WordPress指定关键字加链接方法 By:https://www.cnwper.com/add-keywords-url.html(在新窗口中打开)
function add_keywords_url($text){
$replace = array(
‘wordpress’ => ‘<a href=”https://www.cnwper.com/” rel=”tag” title=”Wordpress标签”>wordpress</a>’,
‘麦子’ => ‘<a href=”https://www.cnwper.com/” rel=”category tag” title=”麦子”>麦子</a>’
);
$text = str_replace(array_keys($replace), $replace, $text);
return $text;
}
add_filter(‘the_content’, ‘add_keywords_url’);
我们可以效仿将关键字和URL进行添加替换,然后添加到 Functions.php 中。
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article. https://accounts.binance.com/en-IN/register?ref=UM6SMJM3