Why Can’t I Override This File?

WordPress allows child themes to override template files by including a copy of the file in the child theme. A template file is a file such as:

  • header.php
  • index.php
  • footer.php
  • sidebar.php
  • archive.php

These are not template files

  • inc/integrations/wp-job-manager/widgets/class-widget-recent-listings.php
  • inc/class-widget.php

A general rule of thumb is that if it is not in the root level directory of /listify/ then it cannot be overwritten.

How Do I Modify Non-Template Files?

If you need to modify a file that cannot be overwritten via a template fie you have a few options:

  • Use the existing filters/actions to modify the output.
  • Use CSS to modify the output
  • If you are trying to override a widget you can copy the file to your child theme then use register_widget() to register the modified widget.

Overriding the output via CSS and WordPress’ hooks and filters is the preferred option.

See:

I Still Need Help Customizing My Theme

We are partnered with and highly recommend Envato Studio or Codeable If you need help customizing your theme.

Was this article helpful?

Related Articles