function get_template_part( $slug, $name = null ) {}

Load a template part into a template
Makes it easy for a theme to reuse sections of code in a easy to overload way for child themes.


  • string $slug: The slug name for the generic template.
  • string $name: The name of the specialised template.

Defined actions

  • get_template_part_{$slug}
    do_action( "get_template_part_{$slug}", $slug, $name );

Source code

function get_template_part( $slug, $name = null ) {

	do_action( "get_template_part_{$slug}", $slug, $name );


No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: