The problem is that you’re not letting the template file do what it is intended to do. Instead of outputting the default loop, you’re ignoring the default loop, and outputting a custom query loop.
Replace all this:
<?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query();
if(!empty($wp->query_vars['term'])){ $terms = $wp->query_vars['term']; $taxonomy = 'term'; }
if(!empty($wp->query_vars['library-tags'])){ $terms = $wp->query_vars['library-tags']; $taxonomy = 'library-tags'; }
$paged = ($wp->query_vars['page']) ? $wp->query_vars['page'] : 1;
$args = array(
'post_type' => 'blog',
'paged' => $paged,
'tax_query' => array(
array(
'taxonomy' => $taxonomy,
'field' => 'slug',
'terms' => $terms
)
)
);
$wp_query->query( $args ); ?>
<?php if ($wp_query->have_posts()) : while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
with the default loop markup:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
Then, your taxonomy-term.php
template file will work properly, including pagination.