Using Option Tree in Child Theme

wordpress

#1

Hi, I have a WordPress theme that has option tree folder in theme folder and in function.php file has a line like this add_filter( 'ot_theme_mode', '__return_true' ); and require (get_template_directory() . 'option-tree/ot-loader.php'); . Now I want to know how can I use it in my child theme? Do I need to copy option tree folder to child theme? Please help me…


#2

Your child theme will start out having two files: style.css and functions.php

It will inherit functionality from the parent theme and you’ll need to enqueue the parent and child theme stylesheets in functions.php.

That’s should be all you need to do to get things working.

Have you tested a child theme on your parent theme as described in the codex docs yet?

https://codex.wordpress.org/Child_Themes


#3

Yes, I have added stylesheets in functions.php file in child theme, but when I activated my child theme it shows many notices and warnings like this failed to open stream: No such file or directory in option-tree/ot-loader.php . But when I am using parent theme it is working fine. Please help what is problem?


#4

Using get_template_directory_uri instead of get_template_directory should help: