title: How to override a parent file in a child Wordpress theme when parent file is being required in functions.php
body: <p>I'm rather new to designing and coding Wordpress themes and have recently started a child theme based on the Sydney theme that's offered free in Wordpress. I have hit a snag I can't work out.</p>
  
  <p>There's a PHP file being called through the parent's <code>functions.php</code> that I need to customize and need to be untouched when I update the parent theme. This file is called <code>template-tags.php</code> and is located inside an "inc" folder. Now, supposedly, according to the Wordpress codex (which I have consulted before asking here), any duplicate files on the child theme (except the <code>functions.php</code>) will automatically override those in the parent theme. I don't know if this works as well for files inside folders but I think the fact that this particular file is being called in the parent's <code>functions.php</code> makes it so that it is the parent's file that is being loaded. I am assuming this because the same goes for the style CSS and JS script files that I had to enqueue in the child theme in order to get my own customized versions in.</p>
  
  <p>However, there is nothing in the Wordpress codex that explains how to override a file that is being already called in the parent's <code>functions.php</code>. And I can't find anything anywhere else (not even in these questions: <a href="https://stackoverflow.com/questions/19687503/wordpress-child-theme-override-a-parent-theme-include">WordPress child theme override a parent theme include</a>, <a href="https://stackoverflow.com/questions/27970572/overiding-parent-theme-functions-with-a-child-theme-in-wordpress">Overiding parent theme functions with a Child theme in WordPress</a>, <a href="https://stackoverflow.com/questions/31284479/how-to-override-a-not-plugable-parent-theme-function-from-a-non-function-php-fil">How to override a not plugable parent theme function from a non function.php file?</a>, <a href="https://stackoverflow.com/questions/24944330/wordpress-child-theme-functions-php-copy-cannot-redeclare">Wordpress child theme - functions.php copy - cannot &quot;redeclare&quot;</a>) that helps me specifically.</p>
  
  <p>So, to sum it all up:</p>
  
  <ul>
  <li>The parent theme has an "inc" folder with the file <code>template-tags.php</code> in it. </li>
  <li>My child theme also has an "inc" folder with the file <code>template-tags.php</code> in it. </li>
  <li><p>The parent theme's <code>functions.php</code> has the following code that calls its file:</p>
  
  <pre><code>require get_template_directory() . '/inc/template-tags.php';
  </code></pre></li>
  <li><p>Anything I try to add in my child's <code>functions.php</code> file that calls its <code>template-tags.php</code> file will result in an error because obviously WP can't require the same thing twice.</p></li>
  </ul>
  
  <p>Short of commenting out the call in the parent's <code>functions.php</code>, which does't seem to me a practical solution but more of a work-around, I have no idea what else to do.</p>
  
  <p>I would appreciate any input at this time. Thanks in advance!</p>