Includes and 'get_template_part'.
-
If in a template I’m including a php file which is in the main theme directory, is there a reason to use ‘get_template_part’ rather than ‘include’? (Other than ‘get_template_part’ fails silently.)
I can’t fully understand ‘get_template_part’, so haven’t been able to use it and instead use ‘include(locate_template())’.
As an example, how would I use ‘get_template_part’ to include a template of ‘part-view-all-posts.php’?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘Includes and 'get_template_part'.’ is closed to new replies.