Should I declare the usage of a new template.php file? How should I declare the usage of a new template.php file in a Drupal 8 sub theme?
I ask since I didn't find anything about this in the documentation, like this example.
For example, I created a template.php file and put the following function inside, saved and flushed all Drupal cache, but the desired change did not occur.
function garku_process_html(&amp;$variables) {
  $variables['styles'] = preg_replace('/.css\?.*&quot;/','.css&quot;', $variables['styles']);
}
Drupal 8 themes don't have template.php files. Now they use a mytheme.theme file, which needs to be located inside the directory containing the theme. (Replace mytheme with the machine name used by the theme.)
Preprocessing and modifying attributes in a .theme file shows an example of preprocess function, which is placed in the mytheme.theme file, instead of the template.php file.