2 posts
  • Bought between 1 and 9 items
  • Has been a member for 1-2 years
JazzCake says

Hello ThemeProvince,

You mentioned there is an index.php file inside option-tree folder. But I have downloaded recently there is no any index.php file. There is ot-loader.php file.

is that same file? if yes please confirm which lines have to replace.

Thanks

Heey Umid! As of OptionTree 2, the index.php is indeed replaced with ot-loader.php.. Here’s what to do:

After placing the option-tree map inside your theme’s map, open your theme’s function.php, and use ThemeProvince’s code to connect with the ot-loader.php file, thus:

require TEMPLATEPATH . '/option-tree/ot-loader.php';

Then, open ot-loader.php, and around line 160 there’s a text that explains enabling OptionTree in theme mode. Right beneath the text you’ll find this code:

define( 'OT_THEME_MODE', apply_filters( 'ot_theme_mode', false ) );

Replace the “false” with “true”.

Aaaaand you’re done! I hope this helps anyone who got stuck since the newer versions :)

119 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Elite Author
  • Envato Staff
  • Exclusive Author
  • Has been a member for 5-6 years
+3 more
valendesigns Staff says

@JazzCake You’re partly correct. However, you would not edit the OptionTree core. You would add the following filter to your functions.php.

add_filter( 'ot_theme_mode', '__return_true' );
2 posts
  • Bought between 1 and 9 items
  • Has been a member for 1-2 years
JazzCake says

@JazzCake You’re partly correct. However, you would not edit the OptionTree core. You would add the following filter to your functions.php. add_filter( 'ot_theme_mode', '__return_true' );

@valendesigns Thanks :D! And great timing, because without that piece of code, my OptionTree would remain looking like a mess! I just wasted time on Google trying to find the solution to it.

119 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Elite Author
  • Envato Staff
  • Exclusive Author
  • Has been a member for 5-6 years
+3 more
valendesigns Staff says

Not a problem, glad to help. Most of the theme mode info can be found on the Documentation page when OT is activated – for future reference. Also, if you read the inline docs above each of those filters, found in ot-loader.php, you can do some interesting things to make OT work exactly the way you want. For example, creating a custom option page for a plugin or feature in your theme or even hiding parts of the settings page; amongst other things. Cheers!

by
by
by
by
by
by