• Hello,

    Can you please help me, what should i do (or write to functions.php file) for make a child from the original “class-sydney-header.php” file?

    I copied the file from “Sydney/int/classes/class-sydney-header.php” to “Sydney-child/int/classes/class-sydney-header.php” direcroty.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @datviking,

    Thank you for contacting us. I am happy to help out with your queries.

    The class is wrapped with pluggable function — checking the class availability.

    
    if ( !class_exists( 'Sydney_Header' ) ) :
    
    endif;
    

    So you can just copy the code (without replicating the file) to your child theme’s functions. Do not include the class checking as seen above.

    Hope this reply helps.

    Regards,
    Kharis

    Thread Starter datviking

    (@datviking)

    Hello,

    Thank you, but my fault, i didn’t specificate the question well, sorry.

    I need to make a child from this file, because i want to replace some of the codes (e.g. the menu) from it.

    The code which i replace the old one is written, only want to change in the child file.

    Thank you very much!

    There is no need for file replication for functions. What you need is to copy that code (without existence checking). File replication is applicable for particular files. See https://developer.wordpress.org/themes/advanced-topics/child-themes/#using-functions-php.

    Regards,
    Kharis

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Child from class-sydney-header.php’ is closed to new replies.