Home Forums WoodMart support forum Child theme files from inc folder

Child theme files from inc folder

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #66268

    Stanley Black
    Participant

    Hello,

    I know that files from inc folder can’t be change in child theme like files from other theme folders, it’s only can modify in child theme functions.php.

    I want to change inc/widgets/class-widget-layered-nav.php file…

    I copied whole class in my child theme functions.php :

    if ( ! class_exists( ‘WOODMART_Widget_Layered_Nav’ ) ) {
    class WOODMART_Widget_Layered_Nav extends WPH_Widget {

    ….

    } // class
    }

    But I got error Fatal error: Class ‘WPH_Widget’ not found in /app/public/wp-content/themes/woodmart-idc/functions.php on line

    Can you give me a hint how to modify inc files in child theme?

    Kind regards

    #66269

    Stanley Black
    Participant

    I changed this function:

    protected function layered_nav_dropdown( $terms, $taxonomy, $query_type ) {
    }

    #66281

    Artem Temos
    Keymaster

    Hi,

    If you want to override the widget PHP Class you need to place a code from the file inc/third-party/wph-widget-class.php before the widget code.

    Regards

    #66338

    Stanley Black
    Participant

    Thank you!!!Works perfect!!!

    Can I do the same thing for js/functions.js file?

    Is it maybe a problem beacause functions.js create functions.min.js?

    Kind regards

    #66368

    Artem Temos
    Keymaster

    Sorry, but there is no way to override JS file in the child theme in WordPress as well as PHP files.

Viewing 5 posts - 1 through 5 (of 5 total)