Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- <?php
- // paste this code on functions php file
- // make sure that directory names are same
- //redux active via theme
- //active with php conditional statement
- 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__ ) . '/inc/theme-option.php' );
- }
- //active with default
- // Activate redux framework
- include_once( 'inc/ReduxCore/framework.php' );
- include_once( 'inc/theme-option.php' );
- // go to redus directory > sample > sample-config php file, and rename it to any name and call it in your functiona.php */
- // If everything is right you have successfully install the redux freamework. :)
- /*****************************************************************/
- // how to use redux in theme
- /*****************************************************************/
- // call redux with default
- <?php global $redux_demo; echo $redux_demo['your_option_id_here']['url'];?>
- // text field value
- <?php global $redux_demo; echo $redux_demo['your_option_id_here'];?>
- // call redux with php if else statement(php if else statement)
- <div class="header">
- <?php global $redux_demo; $your_variable = $redux_demo['your_option_id_here']['url'];?>
- <?php if($your_variable) :?>
- <div class="logo">
- <h1><a href="<?php bloginfo('siteurl') ; ?>"><img src="<?php echo $your_variable; ?>" alt=""/></a></h1>
- </div>
- <?php else : ?> //default data
- <div class="logo">
- <h1><a href="<?php bloginfo('siteurl') ; ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/logo.png" alt=""/></a></h1>
- </div>
- <?php endif; ?>
- </header>
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement