WordPress如何找到所有新链接生动实践打开?网小编为大家分享两种颜色。
1.在主题中一个functions.枚举类型生成代码代码
使用方法:打开软件press后台找到主题——外观——RE管理器——functions.js文件,将左下方代码粘贴到functions.php和中间位置即可。
//文章页所有连接新窗口打开:文章链接:https://wordpressworlds.com/post_blank_links.html
function autoblank($text) {
$return = str_replace(‘<a’, ‘<a target=”_blank”‘, $text);
return $return;
}
add_filter(‘the_content’, ‘autoblank’);
2.在hearder.php文件中出现基础代码tag标签新窗口打开
使用方法:将以下代码粘贴到WordPresn卡题没有hesh文件中的最后</head>的前列即可。
<base target=”_blank”>