I am trying to extend a class that is in the Parent theme, but when I try to add my class in functions.php file getting fatal error, says the parent class not found. My class is something like this:
class MyClasss extends ParentTheme_Templates {
public static function header() {
$type = ParentTheme_Global::instance()->get_header_type();
get_template_part( 'mycomponents/headers/header', $type );
}
but I can use the same code for my class in my template file(I tried in header.php file) and it works, but this is not a proper way I think. So is there any proper method to do this. I can see in the codex:
Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent. Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded right before the parent’s file.)
is there any way to override this issue?