wordpress
wordpress

WordPress 免插件实现外链转内链 Go 跳转,减少权重流失

<?php 
//$t_url=$_GET['url']; //此代码无法支持带请求参数的目的地址,已弃用!
$t_url = preg_replace('/^url=(.*)$/i','$1',$_SERVER["QUERY_STRING"]); //这个支持
if(!empty($t_url)) {
    preg_match('/(http|https):\/\//',$t_url,$matches);
        if($matches){
            $url=$t_url;
            $title='页面加载中,请稍候...';
        } else {
            preg_match('/\./i',$t_url,$matche);
            if($matche){
                $url='http://'.$t_url;
                $title='页面加载中,请稍候...';
            } else {
                $url='http://xubiji.com/';
                $title='参数错误,正在返回首页...';
            }
        }
} else {
    $title='参数缺失,正在返回首页...';
    $url='http://xubiji.com/';
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="refresh" content="2;url='<?php echo $url;?>';">
<title><?php echo $title;?></title>
<style type="text/css">
a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}body{background:#3498db}#loader-container{width:188px;height:188px;color:#fff;margin:0 auto;position:absolute;top:50%;left:50%;margin-right:-50%;transform:translate(-50%,-50%);border:5px solid #3498db;border-radius:50%;-webkit-animation:borderScale 1s infinite ease-in-out;animation:borderScale 1s infinite ease-in-out}#loadingText{font-family:"Microsoft YaHei",Helvetica,Arial,Lucida Grande,Tahoma,sans-serif,Raleway,sans-serif;font-size:1.4em;position:absolute;top:50%;left:50%;margin-right:-50%;transform:translate(-50%,-50%)}@-webkit-keyframes borderScale{0%{border:5px solid #fff}50%{border:25px solid #3498db}100%{border:5px solid #fff}}@keyframes borderScale{0%{border:5px solid #fff}50%{border:25px solid #3498db}100%{border:5px solid #fff}}
</style>
</head>
<body>
<div id="loader-container"><p id="loadingText">   页面加载中...</p></div>
</body>
</html>

复制代码保存为 index.php 文件,然后上传到网站根目录下的 go 文件夹(没有 go 文件夹就新建一个),实现 http://www.172u.top/go/?url=http://www.172u.top/ 的跳转形式。

更新 robots 规则:
为了防止搜索引擎抓取这种跳转链接,我们可以在robots.txt里面新增禁止抓取/go的规则:

Disallow: /go

为导航菜单添加个性图标字体

具体方法:

一、WP后台--插件--安装插件页面搜索:Font Awesome 4 Menus,下载安装并启用。

如果在编辑菜单项目面板中无CSS类,可以打开右上角的“显示选项”,在显示菜单高级属性中勾选“CSS类”(最上面看开启)。

font1.jpg

WP Mail SMTP(可用于wordpress注册,密码找回)

WordPress的功能非常强大,可扩展性也很强大,有时候一些主机不支持mail(),以至于wordpress的自身无法使用密码找回功能!很多人一直在说 1.wordpress 密码无法重置密码 2.wordpress找回密码邮件 无效
这里就可以通通解决了!
下载:后台搜索WP Mail SMTP (最多评价的哪个应该就是)
但是现在有个插件可以实现SMTP发送设置便捷。

20170427154931.png

WordPress知更鸟Begin 4.4主题

最新Wordpress知更鸟Begin 4.4主题已授权,核心文件解密,完美正常使用。CSS3+HTML5、扁平化、响应式设计、自定义颜色风格,不依赖任何前端框架,最高支持到 PHP7.0。

begin4.4.zip
测试还好,没遇到问题,有条件的站长建议购买正版,稳定有原作者的维护!

wordpress全站链接(URL)规范化优化方案

文章页:
建议应采用“/%category%/%postname%.html”格式的链接

采用此结构后搜索引擎在抓取该页面的时候就可以知道该页面是属于那个目录(分类)下的,这样有利于蜘蛛了解整个目录下的主要内容以及目录的主要语义,从而让你的页面在搜索引擎返回同样语义关键词时有更好的排名。