Advertisement
shakil97bd

How to add theme option in wordpress with option-tree

Aug 14th, 2014
469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. **************How to add theme option in wordpress with option-tree*********
  2.  
  3. step 1: Download the option-tree plug-in from wordpress.org
  4.  
  5. step 2: put the option tree plug-in folder in your theme
  6.  
  7. step 3: Than create a folder name: inc in your theme directory and copy *demo-theme-options.php* file from this location>> option-tree/assets/theme-mode/demo-theme-options.php  than past this in the inc foler and rename into *theme-option.php*.
  8.  
  9. step 4: Now call the *ot-loader.php* and *theme-option.php* file in functions.php like bellow.......
  10.  
  11.  
  12. include_once( 'option-tree/ot-loader.php' );
  13. include_once( 'inc/theme-options.php' );
  14.  
  15.  
  16. step 5: copy bellow code in functions.php to active option-tree/theme-option...
  17.  
  18. add_filter( 'ot_show_pages', '__return_true' );      //for option-tree about page
  19. add_filter( 'ot_show_new_layout', '__return_false' ); //for new layout option
  20. add_filter( 'ot_theme_mode', '__return_true' );     //for option-tree css or style
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement