Advertisement
MdRocky

Option tree intallation and uses

Feb 23rd, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!--option tree installation-->
  2.  
  3. <?php
  4. // enable theme option
  5.  
  6. add_filter( 'ot_show_pages', '__return_false' );
  7. add_filter( 'ot_show_new_layout', '__return_false' );
  8. add_filter( 'ot_theme_mode', '__return_true' );
  9. include_once( 'theme_option/ot-loader.php' );
  10. // intregrate theme option
  11. include_once('func/theme-options.php');
  12. // intregrate meta box
  13. include_once('func/meta-boxes.php');
  14.  
  15. ?>
  16.  
  17.  
  18.  
  19. <!--get data from option tree-->
  20.  
  21. <?php if ( function_exists( 'get_option_tree') ) : if( get_option_tree( 'option_id') ) : ?>
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. <!--conditional data from option tree-->
  29.  
  30. <?php if ( function_exists( 'get_option_tree') ) : if( get_option_tree( 'option_id') ) : ?>
  31.  
  32. <?php get_option_tree( 'option_id', '', 'true' ); ?>
  33.  
  34. <?php else : ?>
  35.  
  36. <!--default data goes here-->
  37.  
  38. <?php endif; endif; ?>
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. <!--option tree list item-->
  46.  
  47. <?php // dynamic social link by theme option
  48. $list_item = ot_get_option( 'social-bookmarks', array() );
  49. if ( !empty( $list_item ) ) {
  50.     echo '<div class="content-container">';
  51.     foreach( $list_item as $_social ) {
  52.         echo ' <a href="'.$_social['sicial-bookmarks-icon-link'].'"><i class="fa '.$_social['sicial-bookmarks-icon-name'].'" style="color:'.$_social['sicial-bookmarks-icon-color'].'" title="'.$_social['title'].'"></i></a>';
  53.     }
  54.     echo '</div>';
  55. }
  56. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement