Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

How to override parent files with child theme? WordPress



I created a child theme with this files:


Details about child files:

<strong>et-pagebuilder.php (is included in the parent functions.php with:)</strong>
require_once( get_template_directory() . '/et-pagebuilder/et-pagebuilder.php' );

<strong>layouts.php (is included in the parent et-pagebuilder.php with:)</strong>
require_once( ET_PB_DIR . '/layouts/layouts.php' );

<strong>admin.js (is included in the parent et-pagebuilder.php with:)</strong>
wp_enqueue_script( 'et_pb_admin_js', ET_PB_URI . '/js/admin.js', array( 'jquery', 'jquery-ui-core', 'underscore', 'backbone' ), ET_PB_VERSION, true );

I want to use the child theme files instead of the parent files.
In the files I translated some text from english to romanian.
The theme has support for translation but the .po file does not contain all the text I want to translate.

This is why I want to use the child files instead of the parent files.

How can I remove the parent files and use the child .php and .js files?

(I need to use a child theme to keep the translation when the theme will be updated.)

Thank you

Answers (3)


Navjot Singh answers:

You might need to replicate the function with exact name in child theme's functions.php which calls these php and js files.


John Cotton answers:

Surely, if it's just translations that you want, you'd be better off updating the parent theme to make the extra strings "translatable" and then send those files to the theme author and ask him/her to include those in any future theme release.

Perhaps check with them first, but that's the best approach if they will agree to update the theme.


S├ębastien | French WordpressDesigner answers:

Maybe could you just use the parent theme with this plugin :
[[LINK href=""]][[/LINK]]