How to Use Web Templates in WordPress

How to Create and Use Template Parts in WordPress Twenty Fifteen
Kara Ortega

A call to get_template_part with just the slug parameter tries to load a template file with the slug.php filename. Thus, a call to get_template_part(‘content’) tries to load content.php. A call to get_template_part(‘header’ ,’widgets’) tries to load header-widgets.php. See a pattern here? A slug is simply the name of the template file, minus the .php extension, because WordPress already assumes that it’s a PHP file.

Leave a Reply

Your email address will not be published. Required fields are marked *