在functions.php中使用它
// this will deactive demo mode of reduxframework plugin and will not display and addvertisement
if ( ! function_exists( 'redux_disable_dev_mode_plugin' ) ) {
function redux_disable_dev_mode_plugin( $redux ) {
if ( $redux->args['opt_name'] != 'redux_demo' ) {
$redux->args['dev_mode'] = false;
}
}
add_action( 'redux/construct', 'redux_disable_dev_mode_plugin' );
}
// add sample config to overwrite reduxcore/framework.php
if (!isset($redux_demo)){
require_once(dirname(__FILE__) . '/sample-config.php');
}
要安装 reduxframework 插件,您需要 tgm 插件
您将从这里获得 tgm 插件 --> http://tgmpluginactivation.com/
在您的主题函数中包含 tgm 插件或在 functions.php 中复制和过去的 tgm-init.php 代码,不要忘记 class-tgm-plugin-activation.php 。
示例 --> 安装 redux 框架插件
$plugins = array( // add below code to add redux framework plugin
array(
'name' => 'Redux Framework', // The plugin name.
'slug' => 'redux-framework-master', // The plugin slug (typically the folder name).
'required' => true, // If false, the plugin is only 'recommended' instead of required.
'external_url' => 'https://wordpress.org/plugins/redux-framework', // If set, overrides default API URL and points to an external URL.
'source' => get_stylesheet_directory() . '/plugins/redux-framework-master.zip',
'force_activation' => true,
'force_deactivation' => true,
),
);
force_activation--> true ,当你的主题激活时将激活 reduxframework 。
'force_deactivation' => true,当您的主题停用时,将停用 reduxframework。
你可以在主题文件夹中添加reduxframework,但是当你通过wordpress主题检查主题时,你会得到很多错误。
我已经开发了一个主题,下载并检查它会对你有很大帮助。
http://www.nxcreation.com/alpha-nx-one/