I'm in single.php where I'm trying to get related-posts.php template. The problem is that when using get template part the related-posts.php isn't getting custom taxonomy name from single.php in wp_Query
.
The solution is getting the wp post terms once again in related-posts.php in order to use get_template_part
. But technically it shouldn't be required since parent (single.php) is already having it.
But when I use locate template function it works fine. I feel that this method would be slower than get_template_part
. What should I do?