I would like to overwrite some content which is located in (inc/) template-tags.php file on parent theme.

Content need to be changed is in function footer_content_widget_area in template-tags.php file and that function is called on functions.php:

add_action( 'page_widgets', 'footer_content_widget_area' );
  • How does the parent theme load the file template-tags.php? – Milo Mar 13 '17 at 16:25
  • It is loaded in custom function in functions.php. – Roger Wayne Mar 13 '17 at 18:45

As long as you have a child-theme setup correctly then you just allow the child-theme to replace the parent-theme template by placing the template file in the same location.

So based on the location that you mention in your question you would simply place your edited copy of the template-tags.php in the location child-theme/inc/

the wordpress way of things is explained in the Template_Hierarchy (https://developer.wordpress.org/themes/basics/template-hierarchy/).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.