What is best way passing variables to theme templates and using them different places like widgets?

1 If you look at the source code of get_the_title you will see that there is no difference between the two ways of writing the same thing, because if you call it without a parameter it is supposed to be the current ID.

2 There is no substantial difference between the two loops you use. All go through the same amount of items and do the same thing with it. Theoretically putting everything in archive.php would be a bit faster, because you skip the function call to get_template_part().

In short: when it comes to performance the two options are hardly any different.

Leave a Comment