使用这种在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插件在你的主题功能或复制和过去tgm-init.php在functions.php中的代码,不要忘了class-tgm-plugin-activation.php。
示例 - >安装终极版框架插件
$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 - >真,将激活reduxframework当你的主题将积极。
'force_deactivation'=> true,将在您的主题无效时停用reduxframework。
您可以在主题文件夹中添加reduxframework,但是当您通过wordpress主题检查主题时,您会收到很多错误。
我已经开发了一个主题,下载并检查它会帮助你很多。 http://www.nxcreation.com/alpha-nx-one/
你按照指示在这里:https://github.com/ReduxFramework/redux-framework/wiki/Embedding-Redux-into-Your-Theme-or-Plugin 或正确地调整你的路你上面显示的代码? – AndyWarren
好问题。在文档中没有清楚地列出:http://docs.reduxframework.com/redux-framework/getting-started/ –