Having pages after specifying post_type post

Your cat_n_tag_archives() function is adding pages to all category and tag results indiscriminately. What you probably want (and I am guessing a little) is to restrict that filter to the main query only:

function cat_n_tag_archives($wp_query) {
  if (!$wp_query->is_main_query()) return; // This bit checks for the main query
  $ary_one = array('post', 'page');
  if ($wp_query->get('category_name') || $wp_query->get('cat'))
    $wp_query->set('post_type', $ary_one);
  if ($wp_query->get('tag'))
    $wp_query->set( 'post_type', $ary_one );
}