Category Archive: Tutorials

PHP ‘include’, ‘get_template_part’, and ‘require’: Best Practices

Tutorials

Including files in a PHP environment can be tricky for new developers.  There are no less than four ways to include a file: include, include_once, require, and require_once.  Moreso, there’s very subtle differences in the reasons behind using each one.  Throw in WordPress (which has its own specific flavor of include tag – get_template_part) and it can be downright confusing.  Using the wrong one,…

Continue Reading