Hello @niki Bilejn,
This is actually just a INFO thrown by theme-check. get_template_part() and ‘include or require’ are two different functions for two separate uses. So, if you have separate sections of same file then get_template_part() should be used, except that include/require is just fine if you are including a separate file. For now, you can ignore this info. Reference link can be: https://codex.ww.wp.xz.cn/Function_Reference/get_template_part
Thanks!
If you’re including template files inside other template files you shoudl be using get_template_part() instead of include() or require(). The reason behind this is that by using the WordPress function for get_template_part() will use WordPress’s fallback system for child/parent themes, where the standard PHP functions for include() and require() don’t. It’s mainly going to be enforced for proper functionality to make sure that any future child themes can work as intended. Imagine if someone tries to make a child theme and can’t make a change because they can’t over-ride your template file… that’s why you use get_template_part().
Hi,
Thanks for answering. I know what that info means, just wondering if there a some hack for TGMP to remove that notice. 🙂
Cheers!
Yes. Use get_template_part() instead of include() or require() in your themes template files. It really is that easy.