Best way to allow for extended use of WordPress functions inside single.php

All templates are build within the global scope, so you can access $wp_query, $post, get_queried_object() and get_queried_object_id() anywhere inside the template.

As this is in the header, I will also use a conditional check like is_single() to specifically target the single page