失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 网站的php主题怎么删掉 简介如何去除WordPress主题版权保护的方法 | 垃圾站

网站的php主题怎么删掉 简介如何去除WordPress主题版权保护的方法 | 垃圾站

时间:2021-12-05 05:24:08

相关推荐

网站的php主题怎么删掉 简介如何去除WordPress主题版权保护的方法 | 垃圾站

一些博主[@]好不容易找到喜欢的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文件,搜索代码:

wp_initialize_the_theme

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

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(); } else { echo (“

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.

”); } }

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

function wp_initialize_the_theme_message() { }

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

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($fd, filesize($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();

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

function wp_initialize_the_theme_finish() {} wp_initialize_the_theme_finish();

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

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

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

function wp_initialize_the_theme_load() {}

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

特此声明:本教程只是为了方便站长学习,垃圾站博客不推荐大家删除WP主题发布者连接,毕竟所发布的主题代表了别人的辛勤,在使用别人提供的免费主题时保留发布者的链接是一种对别人的尊重。

如果觉得《网站的php主题怎么删掉 简介如何去除WordPress主题版权保护的方法 | 垃圾站》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。