Extend taxonomy term page with other posts

Ok I find a solution. I use posts_where filter in pre_get_posts. With this filter I can remove the term related WHERE part from the default SQL query.

function custom_loops($query) {
if (is_tax( 'service_photo_location' )){
    $query->set( 'posts_per_page', 10);
    $query->set( 'post__in', $ids);
    $query->set( 'orderby', 'title');
    $query->set( 'order', 'ASC');
    add_filter( 'posts_where', function ( $where ) {
        $where = str_replace("AND ( wp_term_relationships.term_taxonomy_id IN (778) )", "", $where);
        return $where;
    }, 10, 2 );
}
remove_action( 'pre_get_posts', 'custom_loops' );
}
add_action('pre_get_posts', 'custom_loops');

error code: 523