How to override parent theme class function in child theme
-
Hi everyone,
I have been stuck in this place right now. I have woodmart theme, in which want to override Ui class a particular function using child theme. But whenever I extend that class
Fatal error: Uncaught Error: Class 'Ui' not found
error occursI hooked my function using
after_setup_theme
hook in child theme.here is my code snippet.
add_action( 'after_setup_theme', function() { require_once get_theme_file_path( 'inc/integrations/woocommerce/modules/compare/class-ui.php' ); print_r(get_theme_file_path( 'inc/integrations/woocommerce/modules/compare/class-ui.php' )); class a extends Ui{ }});
Please correct me if i commit any mistakes.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to override parent theme class function in child theme’ is closed to new replies.