Can the_post_navigation() be outside of the loop?
Yes, the_post_navigation() works outside of the loop on single post views. Following the function calls, the_post_navigation() uses get_the_post_navigation() which uses get_previous_post_link() and get_next_post_link() which use get_adjacent_post_link() which finally uses get_post() which defaults to the global $post object. Here’s an excerpt of get_adjacent_post_link(): function get_adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms=””, $previous = true, $taxonomy = … Read more