Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Step 01: Download Latest Option tree from wordpress and extract it. Place the Folder 'Option Tree' in the theme directory.
- Step 02: Keep 'meta-boxes.php' & 'theme-options.php' in the inc folder of your theme.
- Step 03: Activate the Theme Option by putting the following code in functions.php
- // add_filter( 'ot_show_pages', '__return_false' );
- add_filter( 'ot_show_new_layout', '__return_false' );
- add_filter( 'ot_theme_mode', '__return_true' );
- include_once( 'option-tree/ot-loader.php' );
- include_once('inc/meta-boxes.php');
- include_once('inc/theme-options.php');
- Since we commented out add_filter( 'ot_show_pages', '__return_false' );by using //, we can see the option tree in the admin area. If we want to hide it, just delete these //.
- Step 04: Create your own 'section' & 'settings' in following way:
- 'sections' => array(
- array(
- 'id' => 'header_settings',
- 'title' => __( 'Header Settings', 'theme-text-domain' )
- ),
- array(
- 'id' => 'footer_settings',
- 'title' => __( 'footer Settings', 'theme-text-domain' )
- ),
- array(
- 'id' => 'social_settings',
- 'title' => __( 'Social Media Settings', 'theme-text-domain' )
- )
- ),
- 'settings' => array(
- array(
- 'id' => 'copyright',
- 'label' => 'Copyright',
- 'desc' => 'Enter Copyright Information',
- 'std' => 'Copyright 2012 Andia - All rights reserved. Template by Azmind.',
- 'type' => 'textarea',
- 'section' => 'footer_settings',
- ),
- array(
- 'id' => 'address',
- 'label' => 'Address',
- 'desc' => 'Enter Address Information',
- 'std' => 'Via Principe Amedeo 9, 10100, Torino, TO, Italy',
- 'type' => 'text',
- 'section' => 'footer_settings',
- ),
- )
- );
- Step 05: Call the variable you created in theme-options.php by using the following code:
- <div class="widget span3">
- <h4>Contact Us</h4>
- <?php
- $address = ot_get_option('address');
- $phone = ot_get_option('phone');
- $skype = ot_get_option('skype');
- $email = ot_get_option('email');
- ?>
- <?php if($address): ?>
- <p><i class="icon-map-marker"></i> Address: <?php echo $address; ?></p>
- <?php else : ?>
- <p><i class="icon-map-marker"></i> Address: Sarasota, CA, USA</p>
- <?php endif; ?>
- <p><i class="icon-envelope-alt"></i> Email: <a href="mailto:"><?php echo $email; ?></a></p>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement