zoukankan      html  css  js  c++  java
  • 简介如何去除WordPress主题版权保护的方法

    一些博主[@www.lajiz.cn]好不容易找到喜欢的Wordpress主题并且希望把主题最下方的版权链接去掉,原以为修改版权链接很容易做到,但在实际操作时确发现并不像自己想象的那么简单,直接修改footer.php文件后再打开网站发现出现下面的错误信息:

    All the links in the footer should remain intact. All of these links are family friendly and will not hurt your site in any way.

    其实Wordpress主题加密主要有两类方法:一种是直接代码直接被加密,另外一种是通过PHP语言的特性实现加密功能。学习本教程大家可以模仿修改本类主题。

    这个是广告编辑地方

    针对上述英文提示的代码加密修改方法如下:进入后台管理页面,打开你的主题,定位functions.php文件,搜索代码:

    1 wp_initialize_the_theme

    第一步:找到下面的一段代码

    1 if (!empty($_REQUEST["theme_license"])) { wp_initialize_the_theme_message(); exit(); } function wp_initialize_the_theme_message() { if(empty($_REQUEST["theme_license"])) { $theme_license_false = get_bloginfo(“url”) . “/index.php?theme_license=true”; echo “”; exit(); } elseecho (“
    2  
    3 All the links in the footer should remain intact. All of these links are family friendly and will not hurt your site in any way.
    4  
    5 ”); } }

    删除如上该段代码,并在原来位置用如下代码填充代替

    1 function wp_initialize_the_theme_message() { }

    第二步:继续向下找到该段代码

    1 function wp_initialize_the_theme_finish() { $uri strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri, “wp-admin”) > 0 || substr_count($uri, “wp-login”) > 0 ) { /* */ else $l = ‘Designed by: Free SharePoint | Todays Current WordPress Themes Directory, Wicked Pittsburgh and WordPress Themes Free’; $f = dirname(__file__) . “/footer.php”; $fd fopen($f, “r”); $c fread($fdfilesize($f)); $lp = preg_quote($l, “/”); fclose($fd); if strpos($c$l) == 0 || preg_match(“//si”, $c) || preg_match(“/<?php([^?]+[^ >]+” . $lp . “.*)?>/si”, $c) ) { wp_initialize_the_theme_message(); die; } } } wp_initialize_the_theme_finish();

    整段代码删除,并用如下代码代替填入原有位置

    1 function wp_initialize_the_theme_finish() {} wp_initialize_the_theme_finish();

    第三步:找到下面的一段代码

    1 function wp_initialize_the_theme_load() { if(!function_exists(“wp_initialize_the_theme”)) { wp_initialize_the_theme_message(); die; } }

    整段代码删除,复制以下内容填充进去

    1 function wp_initialize_the_theme_load() {}

    点击保存,完成对functions.php文件的修改后,再打开footer.php文件就可以随便修改版权信息了。看其来挺复杂,其实如果不需要做研究,那你只需要仔细对照,别改错了就行了。

  • 相关阅读:
    AUSU 安装Win10注意事项
    华硕笔记本无法设置U盘启动,快捷启动不能识别
    postgres 得到所有表空间 和 表空间的位置
    python 远程链接、搜索与下载
    python 读取 postgreSQL 数据保存CSV文件
    weka 初练之 文本分类
    基于springMVC+mybatis的实践记录
    简单的springMVC + mybatis 编写程序流程
    sql查询 生成列号
    通过资源文件 验证拦截机制
  • 原文地址:https://www.cnblogs.com/wpxuexi/p/7134418.html
Copyright © 2011-2022 走看看