使用這種在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/ –