I’m building locally or I would provide a link. Here’s my code though:
add_action( 'loop_start', 'my_loop_start' );
function my_loop_start( $query ) {
if( $query->is_main_query() ) {
add_filter( 'the_content', 'my_navigation' );
add_action( 'loop_end', 'my_loop_end' );
}
}
function my_navigation( $content ) {
$my_nav = previous_post_link('%link', '<<', true);
$my_nav .= next_post_link('%link', '>>', true);
$content = $my_nav . $content;
return $content;
}
function my_loop_end() {
remove_action( 'the_post', 'my_navigation' );
}
It’s not working within the theme that is the issue, it is the post_link functions relate only to all post index queries or particular taxonomy queries of the post post type. The queries these functions make to find the next post are partly hardcoded and only certain portions are filtered, so it’s difficult to make these work for custom situations.
I suggest you develop your own versions of these functions. You can work from the original source code, changing things as needed.