kaioe
5/14/2016 - 12:26 AM

Wordpress: Locate and include

Locate and include: (get_template_part)

You can use the WordPress locate_template function within PHP’s include().

It’s done like this:

  1. include(locate_template('your-template-name.php'));

All of the variables available in your current script will be available in that template file now too.

include(locate_template('{your-template-name.php}'));