Passing variables to get_template_part() in WordPress

This morning I needed to pass a variable to a file that I was including using the WordPress get_template_part function. I was fiddling around with global variables when I thought there must be a better way. There is. Locate and include You can use the WordPress locate_template function within PHP’s include(). It’s done like this: [code]include(locate_template(‘your-template-name.php’));[/code] … Continue reading Passing variables to get_template_part() in WordPress