当我们安装主题和插件时,都会向…
贡献一个Worepress企业主题,自己在主题森林买的,可以看下图(等有时间再更新一下贴子,增加The7对中文站来说添加中文字体的方法)
目前是最新版本v.6.2.2 (Mar 15, 2018),官方链接https://themeforest.net/item/the7-responsive-multipurpose-wordpress-theme/5556590
官方演示主页:http://the7.io/
主题为原版源码,含简体中文语言包(官方的汉化)
下载链接,或者免费下载地址:https://shop.mac163.com/portfolio-item/506/
主题为国外主题,更多演示详见官网,截了几张官方的图:
主题为原版源码,是需要授权码进行授权的,安装主题之后,后台会提示未注册,不注册并不会影响使用,只影响到在线升级和演式内容的导入,若想把未注册变为注册,请接着往下看。
修改主题里面的dt-the7\inc\mods\demo-content\includes\class-the7-demo-content-remote-server-api.php文件,具体修改如下:
第8行添加以下代码:
update_site_option( ‘the7_registered’, ‘yes’ );
update_site_option( ‘the7_purchase_code’, ‘the7_purchase_code’ );
如下:
<?php /** * DT Dummy remote API. Used to communicate with DT dummy server. * * @since 2.0.0 * @package dt-dummy/includes */ update_site_option( 'the7_registered', 'yes' ); update_site_option( 'the7_purchase_code', 'the7_purchase_code' ); class The7_demo_Content_Remote_Server_API {
修改后保存,安装主题后,主题将显示为已注册,如下图:
若想要导放官方的演式内容,接着往下修改:
删除95行至110行的内容,红色为要删除的代码
$request_url = add_query_arg( array( ‘item’ => $id, ‘code’ => $code ), $this->api_remote_download_url );
$remote_response = wp_safe_remote_get( $request_url, array(
‘timeout’ => 300,
‘user-agent’ => ‘WordPress/’ . get_bloginfo( ‘version’ ) . ‘; ‘ . network_site_url(),
) );
if ( is_wp_error( $remote_response ) ) {
return $remote_response;
}
$response_code = wp_remote_retrieve_response_code( $remote_response );
if ( ! is_array( $remote_response ) || 200 != $response_code ) {
return new WP_Error( ‘download_failed’, $this->strings[‘download_failed’] );
}
删除114行的内容,红色为要删除的代码
$file_content = wp_remote_retrieve_body( $remote_response );
删除116行的内容,红色为要删除的代码
$wp_filesystem->put_contents( $zip_file_name, $file_content );
以下为原文件部份内容
public function download_dummy( $id, $code, $target_dir ) { /** * @var $wp_filesystem WP_Filesystem_Base */ global $wp_filesystem; if ( ! $wp_filesystem && ! WP_Filesystem() ) { return new WP_Error( 'fs_unavailable', $this->strings['fs_unavailable'] ); } if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() ) { return new WP_Error( 'fs_error', $this->strings['fs_error'], $wp_filesystem->errors ); } $request_url = add_query_arg( array( 'item' => $id, 'code' => $code ), $this->api_remote_download_url ); $remote_response = wp_safe_remote_get( $request_url, array( 'timeout' => 300, 'user-agent' => 'WordPress/' . get_bloginfo( 'version' ) . '; ' . network_site_url(), ) ); if ( is_wp_error( $remote_response ) ) { return $remote_response; } $response_code = wp_remote_retrieve_response_code( $remote_response ); if ( ! is_array( $remote_response ) || 200 != $response_code ) { return new WP_Error( 'download_failed', $this->strings['download_failed'] ); } wp_mkdir_p( $target_dir ); $file_content = wp_remote_retrieve_body( $remote_response ); $zip_file_name = trailingslashit( $target_dir ) . "{$id}.zip"; $wp_filesystem->put_contents( $zip_file_name, $file_content ); $unzip_result = unzip_file( $zip_file_name, $target_dir ); if ( is_wp_error( $unzip_result ) ) { return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], $unzip_result ); } $dummy_dir = trailingslashit( $target_dir ) . $id; if ( ! is_dir( $dummy_dir ) ) { return new WP_Error( 'fs_no_folder', sprintf( $this->strings['fs_no_folder'], $dummy_dir ) ); } return $dummy_dir; }
修改后保存,安装主题后,主题将显示为已注册,上传the7-demo-content-tmp(文件在下方下载)文件夹到Wordpress的wp-content/uploads/ 目录下,然后转到仪表盘的 The7 – Pre-made Websites,开始导入你想要的演示吧,如下图:
the7-demo-content-tmp演示数据下载地址:
链接:http://pan.baidu.com/s/1c1FZrJM 密码:x0ss
插件下载地址:
链接:http://pan.baidu.com/s/1c1A9Ge0 密码:iabw
上传一个已经修改好的文件,下载后可以直接上传替换,也可以下载后对比原文件,看看是修改了那些内容,然后自行修改上传替换,注意:因为论坛只能传图片和txt文件,所以后辍加了.txt,下载后去掉后辍.txt
最后说明一点,在安装演示内容的时候,需要安装所必须的插件,英文好的,一看提示便知
如果演示内容导入不了的,又想要演示内容,可以在本地安装4.2.2的版本,导入内容后,再把内容导出,放到真正的网站上面,因为演示内容是国外进口,所以最好挂着VPN来导入,不然速度很慢,而且会导入失败,导放时不建议选上导入附件,时间会很长,PHP时间最好设长一点。附上4.2.2的官方原版,这个也是官方最后一个可以免费导入演示内容的版本,从5.0开始官方不再免费导入演示内容,除非是正式购买用户有购买代码的。

微信扫描二维码联系我们!
我们在微信上24小时期待你的声音
提供外贸路由器设备产品,轻松翻墙,解答:WP主题推荐,WP网站建设,Google SEO,百度SEO,专业服务器环境搭建等!
需要提供WordPress主题/插件的汉化服务可以随时联系我们!另外成品WordPress网站以及半成品WordPress网站建设,海外Google SEO优化托管服务,百度SEO优化托管服务,Centos/Debian服务器WP专用环境搭建,WP缓存服务器搭建,我们都是你的首选,拥有多年WP开源程序服务经验,我们一直在坚持客户体验,没有最好,只有更好!