Skip to main content
edited body
Source Link
Jacob Peattie
  • 43.9k
  • 10
  • 49
  • 62

locate_template() is not pluggable, and there's no filter. A filter was proposed a decodedecade ago, but it hasn't been implemented. The ticket for that is here, so you can read that discussion to get an idea of why it might not have happened yet.

The template hierarchy filters might be helpful. They will let you filter the template hierarchy for the top-level templates like page.php, date.php, or category.php etc. Similarly, the template_include filter will let you replace the entire template used to render any given page.

But really, WordPress is not designed to support 3 levels of inheritance for templates. The "proper" solution to your problem would be to copy the child theme to a new theme and make your changes to that.

locate_template() is not pluggable, and there's no filter. A filter was proposed a decode ago, but it hasn't been implemented. The ticket for that is here, so you can read that discussion to get an idea of why it might not have happened yet.

The template hierarchy filters might be helpful. They will let you filter the template hierarchy for the top-level templates like page.php, date.php, or category.php etc. Similarly, the template_include filter will let you replace the entire template used to render any given page.

But really, WordPress is not designed to support 3 levels of inheritance for templates. The "proper" solution to your problem would be to copy the child theme to a new theme and make your changes to that.

locate_template() is not pluggable, and there's no filter. A filter was proposed a decade ago, but it hasn't been implemented. The ticket for that is here, so you can read that discussion to get an idea of why it might not have happened yet.

The template hierarchy filters might be helpful. They will let you filter the template hierarchy for the top-level templates like page.php, date.php, or category.php etc. Similarly, the template_include filter will let you replace the entire template used to render any given page.

But really, WordPress is not designed to support 3 levels of inheritance for templates. The "proper" solution to your problem would be to copy the child theme to a new theme and make your changes to that.

Source Link
Jacob Peattie
  • 43.9k
  • 10
  • 49
  • 62

locate_template() is not pluggable, and there's no filter. A filter was proposed a decode ago, but it hasn't been implemented. The ticket for that is here, so you can read that discussion to get an idea of why it might not have happened yet.

The template hierarchy filters might be helpful. They will let you filter the template hierarchy for the top-level templates like page.php, date.php, or category.php etc. Similarly, the template_include filter will let you replace the entire template used to render any given page.

But really, WordPress is not designed to support 3 levels of inheritance for templates. The "proper" solution to your problem would be to copy the child theme to a new theme and make your changes to that.