How to include Redux Framework in Theme

How do I include Redux Framework in Theme wordpress?

This code doesn’t work:

<?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' );
  }
?>

Related posts

Leave a Reply

6 comments

  1. Try These Steps hope that helps

    Step 1
    : Download Redux framework

    Step 2: Extract / Unzip downloaded redux framework files.

    Step 3: Copy ReduxCore folder from extracted / unzip files into your active theme directory.

    Step 4: Create New folder in your current active theme directory called functions

    Step 5: Copy downloaded framework file sample-config.php from sample directory into your theme functions folder

    Step 6: Rename this copied file from sample-config.php to admin-config.php

    Step 7: Copy paste this code in bottom of your functions.php file.

    if( !class_exists('ReduxFramework')){
        require_once(dirname(__FILE__) . '/ReduxCore/Framework.php');
    }
    
    if( !isset( $redux_demo ) ){
        require_once( dirname( __FILE__) . '/functions/admin-config.php');
    }
    

    Step 8: That’s it. Now you can see theme options in your theme.
    further you can customize your /functions/admin-config.php file based on your requirements.

    Reference link

  2. For my works:

        // 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' );
    }
    

    I have folder framework end in him i have ReduxCore end sample folder…check the code…
    Photo

  3. use this in 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');
    }
    

    To install the reduxframework plugin you will need tgm plugin

    you will get tgm plugin from here –> http://tgmpluginactivation.com/

    include tgm plugin in your theme function or copy and past tgm-init.php code in functions.php , don’t forget about class-tgm-plugin-activation.php .

    Example –> install redux framework plugin

    $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 , will active reduxframework when your theme will active .

    ‘force_deactivation’ => true, will deactive reduxframework when your theme will deactive .

    you can add reduxframework in theme folder , but when you will check theme by wordpress theme check you will get many error .

    I already developed a theme , download and check it it will help you a lot.
    http://www.nxcreation.com/alpha-nx-one/

  4. In that link http://tgmpluginactivation.com/download/ generate plugin activation file (“class-tgm-plugin-activation.php” include the file into your theme folder) download zip file

    In that file “Array of plugin arrays”

    add the code

    // 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,       
        ),
    );
    

    In this use for plugin path

    ‘source’ => ‘repo’,

  5. Simple way to include redux framework in wordpress theme.

        // Including Redux Framework
        require_once (dirname(__FILE__) . '/redux/redux-framework.php');
        if ( class_exists( 'Redux' ) ) {
            require_once (dirname(__FILE__) . '/redux/sample/barebones-config.php');
        }