templates - Is there potential plugin incompatibility if theme has no header.php and footer.php?

admin2025-01-08  7

I apologise if I'm asking something which has been previously covered - but I've not been able to find an answer.

In updating a classic theme for personal use, I considered dispensing with the header.php and footer.php templates, and including the wp_head() and wp_footer() calls in the correct locations within my existing 'pre-loop' and 'post-loop' custom templates.

But I then read about potential problems with plugin compatibility - suggesting that some plugins (expecting header.php and footer.php to be present in the theme root) might use hardcoded paths to them. From my very limited amateur knowledge, this seems unlikely as header.php and footer.php aren't required by WordPress.

Advice appreciated - please and thankyou.

I apologise if I'm asking something which has been previously covered - but I've not been able to find an answer.

In updating a classic theme for personal use, I considered dispensing with the header.php and footer.php templates, and including the wp_head() and wp_footer() calls in the correct locations within my existing 'pre-loop' and 'post-loop' custom templates.

But I then read about potential problems with plugin compatibility - suggesting that some plugins (expecting header.php and footer.php to be present in the theme root) might use hardcoded paths to them. From my very limited amateur knowledge, this seems unlikely as header.php and footer.php aren't required by WordPress.

Advice appreciated - please and thankyou.

Share Improve this question asked Nov 26, 2024 at 18:44 gullivergulliver 12311 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I believe that it should be fine for themes to not have header.php or footer.php files. Block themes generally do not have these files. For example Twenty Twenty-Four, a theme built by the WordPress team.

If a plugin errors because a theme does not have the aforementioned files, then I would chalk it to some naivety in the way the plugin was coded and would avoid said plugin.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736266461a1122.html

最新回复(0)