Glossary Term
get_template_part()
get_template_part() — Loads a template part into a template. Provides a simple mechanism for child themes to overload reusable sections of code in the theme. Includes the named template part for a theme or if a name is specified then a specialized part will be included. If the theme contains no {slug}.php file then no template will be included. The template is included using require, not require_once, so you may include the same template part multiple times. For the $name parameter, if the file is called “{slug}-special.php” then specify “special”.
Inputs: $slug (string): The slug name for the generic template. $name (string|null): Optional. The name of the specialized template. Default null. $args (array): Optional. Additional arguments passed to the template. Default empty array.
Returns void|false: Void on success, false if the template does not exist.
Term Connections
Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.
Loading term connections…
