真正的原版The7响应式多用途的WordPress企业主题+改为已注册方法

贡献一个Worepress企业主题,大家可以看下图
目前是最新版本v.5.6.0.1 (Oct 13, 2017)
官方链接:https://themeforest.net/item/the7-responsive-multipurpose-wordpress-theme/5556590
官方演示主页:http://the7.io/
主题为原版源码,含简体中文语言包(官方的汉化)
下载链接:http://pan.baidu.com/s/1qYibbrQ 密码:0f48 <—刮开
主题为原版源码,是需要授权码进行授权的,安装主题之后,后台会提示未注册,不注册并不会影响使用,只影响到在线升级和演式内容的导入,若想把未注册变为注册,请接着往下看。
修改主题里面的dt-the7incmodsdemo-contentincludesclass-the7-demo-content-remote-server-api.php文件,具体修改如下:
第8行添加以下代码:
update_site_option( ‘the7_registered’, ‘yes’ );
update_site_option( ‘the7_purchase_code’, ‘the7_purchase_code’ );
如下:

<?php
/**
 * DTDummy remote API. Used to communicate with DTdummy 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 );

以下为原文件部份内容

publicfunction 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,开始导入你想要的演示吧,如下图:
234520qncranivrnrkztcl

the7-demo-content-tmp演示数据下载地址:
链接:http://pan.baidu.com/s/1c1FZrJM 密码:x0ss
插件下载地址:
链接:http://pan.baidu.com/s/1c1A9Ge0 密码:iabw
 

Read more