3

テーマ wordpress に Redux Framework を含めるにはどうすればよいですか?

このコードは機能しません:

<?php
  if ( !class_exists( 'ReduxFramework' ) && file_exists( dirname( __FILE__ ) . '/ReduxFramework/ReduxCore/framework.php' ) ) {
    require_once( dirname( __FILE__ ) . '/ReduxFramework/ReduxCore/framework.php' );
  }
  if ( !isset( $redux_demo ) && file_exists( dirname( __FILE__ ) . '/ReduxFramework/sample/sample-config.php' ) ) {
    require_once( dirname( __FILE__ ) . '/ReduxFramework/sample/sample-config.php' );
  }
?>
4

6 に答える 6

1

私の作品のために:

    // load the theme's framework
if ( !class_exists( 'ReduxFramework' ) && file_exists( dirname(__FILE__) . '/framework/ReduxCore/framework.php' ) ) {
require_once( dirname(__FILE__) . '/framework/ReduxCore/framework.php' );
}

// load the theme's options 
if ( !isset( $redux_owd ) && file_exists( dirname(__FILE__) . '/framework/sample/sample-config.php' ) ) {
require_once( dirname(__FILE__) . '/framework/sample/sample-config.php' );
}

私は彼にフォルダーフレームワークの終わりを持っています私はReduxCoreエンドサンプルフォルダーを持っています...コードを確認してください... 写真

于 2014-03-11T07:59:55.660 に答える
1

これを 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、テーマが deactive になると reduxframework を非アクティブにします。

テーマフォルダにreduxframeworkを追加できますが、ワードプレスのテーマチェックでテーマをチェックすると、多くのエラーが発生します。

私はすでにテーマを開発しました。ダウンロードして確認すると、大いに役立ちます。 http://www.nxcreation.com/alpha-nx-one/

于 2015-02-16T19:01:00.287 に答える
0

そのリンクでhttp://tgmpluginactivation.com/download/プラグイン アクティベーション ファイルを生成します (「class-tgm-plugin-activation.php」はファイルをテーマ フォルダに含めます) zip ファイルをダウンロードします

そのファイルの「プラグイン配列の配列」

コードを追加する

// add below code to add redux framework plugin

$plugins = array( 
    array(
        'name'               => 'Redux Framework', // The plugin name.
        'slug'               => 'redux-framework', // The plugin slug (typically the folder name).
        'required'           => false, 
        'version'           => '3.6.1',
        'external_url'       => 'https://wordpress.org/plugins/redux-framework', 
        'source'             => 'repo', 
        'force_activation'   => false,
        'force_deactivation' => false,       
    ),
);

このプラグインパスの使用

'ソース' => 'レポ',

于 2016-09-15T13:45:09.790 に答える
0

wordpress テーマに redux フレームワークを含める簡単な方法。

    // Including Redux Framework
    require_once (dirname(__FILE__) . '/redux/redux-framework.php');
    if ( class_exists( 'Redux' ) ) {
        require_once (dirname(__FILE__) . '/redux/sample/barebones-config.php');
    }
于 2017-08-08T12:05:36.713 に答える