Currently, I am using require_once/include to import different functions in functions.php using:
include( 'functions/heading.php' )
Theme check advises me to use “get_template_part()”. How can I achieve this?
Forget about that, Theme check cannot be that smart
If those included files are php code only (functions/classes/etc.), they cannot be template part
get_template_part() it allows users to edit that particular file by adding their own version in a child theme. If it is a file they are unlikely to need to edit then using
include shouldn’t be a problem. If it’s something like a navigation bar or section of HTML they might want to edit then go with
- Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
- Open a support ticket if you would like specific help with your account, deposits or purchases.
- Item Support by authors is optional and may vary. Please see the Support tab on each item page.
Most of all, enjoy your time here. Thank you for being a valued Envato community member.