I browsed forums but most answers on this are vague.
Can someone please advise if we can use this
include(locate_template('template_name.php'));
to include template parts.
Any help is appreciated!
I browsed forums but most answers on this are vague.
Can someone please advise if we can use this
include(locate_template('template_name.php'));
to include template parts.
Any help is appreciated!
Could someone please give us a hint. Thank you!
Wordpress? Why donāt you use get_template_part?
No you canāt use that in WP themes.
I need to pass variable to templates and none of the default wp ways allow it.
locate_template() is perfectly fine to be used, also per submission requirements;
If incorporated into the theme, custom template ļ¬les are required to be called using get_template_part() or locate_template()
but what I am asking about is the combo of include and locate_template() which I also found in several TF WP themes.